3 * Marks the nodes listed in drupalSettings.history.nodesToMarkAsRead as read.
5 * Uses the History module JavaScript API.
10 (function(window, Drupal, drupalSettings) {
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
13 // "DOMContentReady" event) to add "new" and "updated" indicators.
14 window.addEventListener('load', () => {
15 if (drupalSettings.history && drupalSettings.history.nodesToMarkAsRead) {
16 Object.keys(drupalSettings.history.nodesToMarkAsRead).forEach(
17 Drupal.history.markAsRead,
21 })(window, Drupal, drupalSettings);