summaryrefslogtreecommitdiffstatshomepage
path: root/core/modules/comment/js
diff options
context:
space:
mode:
authorwebchick <drupal@webchick.net>2017-11-28 15:40:07 -0800
committerwebchick <drupal@webchick.net>2017-11-28 15:40:07 -0800
commitb0a4d7e0173be1f91e6bb6001e6186d2b580861d (patch)
tree059c95af2bd1ed504e09a8cde0156ab60e861753 /core/modules/comment/js
parent67207f792b24b92787b6435c60a7e68f3946df66 (diff)
downloaddrupal-b0a4d7e0173be1f91e6bb6001e6186d2b580861d.tar.gz
drupal-b0a4d7e0173be1f91e6bb6001e6186d2b580861d.zip
Issue #2925064 by drpal, dawehner, xjm, justafish, droplet: [1/2] JS codestyle: no-restricted-syntax
Diffstat (limited to 'core/modules/comment/js')
-rw-r--r--core/modules/comment/js/node-new-comments-link.es6.js6
-rw-r--r--core/modules/comment/js/node-new-comments-link.js6
2 files changed, 6 insertions, 6 deletions
diff --git a/core/modules/comment/js/node-new-comments-link.es6.js b/core/modules/comment/js/node-new-comments-link.es6.js
index e32c38cde0c..ff986cd9a51 100644
--- a/core/modules/comment/js/node-new-comments-link.es6.js
+++ b/core/modules/comment/js/node-new-comments-link.es6.js
@@ -149,15 +149,15 @@
* Data about new comment links indexed by nodeID.
*/
function render(results) {
- for (const nodeID in results) {
- if (results.hasOwnProperty(nodeID) && $placeholdersToUpdate.hasOwnProperty(nodeID)) {
+ Object.keys(results).forEach((nodeID) => {
+ if ($placeholdersToUpdate.hasOwnProperty(nodeID)) {
$placeholdersToUpdate[nodeID]
.attr('href', results[nodeID].first_new_comment_link)
.text(Drupal.formatPlural(results[nodeID].new_comment_count, '1 new comment', '@count new comments'))
.removeClass('hidden');
show($placeholdersToUpdate[nodeID]);
}
- }
+ });
}
if (drupalSettings.comment && drupalSettings.comment.newCommentsLinks) {
diff --git a/core/modules/comment/js/node-new-comments-link.js b/core/modules/comment/js/node-new-comments-link.js
index 37fdb58c5e1..366e4e758b4 100644
--- a/core/modules/comment/js/node-new-comments-link.js
+++ b/core/modules/comment/js/node-new-comments-link.js
@@ -70,12 +70,12 @@
}
function render(results) {
- for (var nodeID in results) {
- if (results.hasOwnProperty(nodeID) && $placeholdersToUpdate.hasOwnProperty(nodeID)) {
+ Object.keys(results).forEach(function (nodeID) {
+ if ($placeholdersToUpdate.hasOwnProperty(nodeID)) {
$placeholdersToUpdate[nodeID].attr('href', results[nodeID].first_new_comment_link).text(Drupal.formatPlural(results[nodeID].new_comment_count, '1 new comment', '@count new comments')).removeClass('hidden');
show($placeholdersToUpdate[nodeID]);
}
- }
+ });
}
if (drupalSettings.comment && drupalSettings.comment.newCommentsLinks) {