Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / core / misc / tableselect.es6.js
index a92fdd5f17c8416c4165e77ad4a5f5fa2c0e8e71..d3f852dd27d10deedc3a4676a5b54d834f5b2efe 100644 (file)
   Drupal.behaviors.tableSelect = {
     attach(context, settings) {
       // Select the inner-most table in case of nested tables.
-      $(context).find('th.select-all').closest('table').once('table-select').each(Drupal.tableSelect);
+      $(context)
+        .find('th.select-all')
+        .closest('table')
+        .once('table-select')
+        .each(Drupal.tableSelect);
     },
   };
 
 
     // Traverse through the sibling nodes.
     for (let i = from[mode]; i; i = i[mode]) {
-      var $i;
+      const $i = $(i);
       // Make sure that we're only dealing with elements.
       if (i.nodeType !== 1) {
         continue;
       }
-      $i = $(i);
       // Either add or remove the selected class based on the state of the
       // target checkbox.
       $i.toggleClass('selected', state);