3 * Attaches behaviors for the Comment module's "by-viewer" class.
6 (function ($, Drupal, drupalSettings) {
11 * Add 'by-viewer' class to comments written by the current user.
13 * @type {Drupal~behavior}
15 Drupal.behaviors.commentByViewer = {
16 attach: function (context) {
17 var currentUserID = parseInt(drupalSettings.user.uid, 10);
18 $('[data-comment-user-id]')
20 return parseInt(this.getAttribute('data-comment-user-id'), 10) === currentUserID;
22 .addClass('by-viewer');
26 })(jQuery, Drupal, drupalSettings);