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]')
18 parseInt(this.getAttribute('data-comment-user-id'), 10) ===
22 .addClass('by-viewer');
25 })(jQuery, Drupal, drupalSettings);