Mercurial > hg > cmmr2012-drupal-site
comparison core/modules/history/js/mark-as-read.es6.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 |
comparison
equal
deleted
inserted
replaced
3:307d7a7fd348 | 4:a9cd425dd02b |
---|---|
5 * Uses the History module JavaScript API. | 5 * Uses the History module JavaScript API. |
6 * | 6 * |
7 * @see Drupal.history | 7 * @see Drupal.history |
8 */ | 8 */ |
9 | 9 |
10 (function (window, Drupal, drupalSettings) { | 10 (function(window, Drupal, drupalSettings) { |
11 // When the window's "load" event is triggered, mark all enumerated nodes as | 11 // When the window's "load" event is triggered, mark all enumerated nodes as |
12 // read. This still allows for Drupal behaviors (which are triggered on the | 12 // read. This still allows for Drupal behaviors (which are triggered on the |
13 // "DOMContentReady" event) to add "new" and "updated" indicators. | 13 // "DOMContentReady" event) to add "new" and "updated" indicators. |
14 window.addEventListener('load', () => { | 14 window.addEventListener('load', () => { |
15 if (drupalSettings.history && drupalSettings.history.nodesToMarkAsRead) { | 15 if (drupalSettings.history && drupalSettings.history.nodesToMarkAsRead) { |
16 Object.keys(drupalSettings.history.nodesToMarkAsRead).forEach(Drupal.history.markAsRead); | 16 Object.keys(drupalSettings.history.nodesToMarkAsRead).forEach( |
17 Drupal.history.markAsRead, | |
18 ); | |
17 } | 19 } |
18 }); | 20 }); |
19 }(window, Drupal, drupalSettings)); | 21 })(window, Drupal, drupalSettings); |