3 * Attaches behaviors for the Comment module's "by-viewer" class.
6 (function ($, Drupal, drupalSettings) {
8 * Add 'by-viewer' class to comments written by the current user.
10 * @type {Drupal~behavior}
12 Drupal.behaviors.commentByViewer = {
14 const currentUserID = parseInt(drupalSettings.user.uid, 10);
15 $('[data-comment-user-id]')
17 return parseInt(this.getAttribute('data-comment-user-id'), 10) === currentUserID;
19 .addClass('by-viewer');
22 }(jQuery, Drupal, drupalSettings));