Mercurial > hg > cmmr2012-drupal-site
annotate core/modules/comment/js/comment-by-viewer.js @ 4:a9cd425dd02b
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:11:55 +0000 |
parents | c75dbcec494b |
children |
rev | line source |
---|---|
Chris@0 | 1 /** |
Chris@0 | 2 * DO NOT EDIT THIS FILE. |
Chris@0 | 3 * See the following change record for more information, |
Chris@0 | 4 * https://www.drupal.org/node/2815083 |
Chris@0 | 5 * @preserve |
Chris@0 | 6 **/ |
Chris@0 | 7 |
Chris@0 | 8 (function ($, Drupal, drupalSettings) { |
Chris@0 | 9 Drupal.behaviors.commentByViewer = { |
Chris@0 | 10 attach: function attach(context) { |
Chris@0 | 11 var currentUserID = parseInt(drupalSettings.user.uid, 10); |
Chris@0 | 12 $('[data-comment-user-id]').filter(function () { |
Chris@0 | 13 return parseInt(this.getAttribute('data-comment-user-id'), 10) === currentUserID; |
Chris@0 | 14 }).addClass('by-viewer'); |
Chris@0 | 15 } |
Chris@0 | 16 }; |
Chris@0 | 17 })(jQuery, Drupal, drupalSettings); |