Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / block / js / block.admin.es6.js
index 780ea12e2e70c9e3f07eccbfe86959f46a54f1f5..197bc4beadd6460a4f9383152e68e76f2e613361 100644 (file)
@@ -3,7 +3,7 @@
  * Block admin behaviors.
  */
 
-(function ($, Drupal, debounce) {
+(function($, Drupal, debounce) {
   /**
    * Filters the block list by a text input search string.
    *
@@ -33,7 +33,9 @@
        *   The jQuery event for the keyup event that triggered the filter.
        */
       function filterBlockList(e) {
-        const query = $(e.target).val().toLowerCase();
+        const query = $(e.target)
+          .val()
+          .toLowerCase();
 
         /**
          * Shows or hides the block entry based on the query.
         function toggleBlockEntry(index, label) {
           const $label = $(label);
           const $row = $label.parent().parent();
-          const textMatch = $label.text().toLowerCase().indexOf(query) !== -1;
+          const textMatch =
+            $label
+              .text()
+              .toLowerCase()
+              .indexOf(query) !== -1;
           $row.toggle(textMatch);
         }
 
               '@count blocks are available in the modified list.',
             ),
           );
-        }
-        else {
-          $filterRows.each(function (index) {
-            $(this).parent().parent().show();
+        } else {
+          $filterRows.each(function(index) {
+            $(this)
+              .parent()
+              .parent()
+              .show();
           });
         }
       }
   Drupal.behaviors.blockHighlightPlacement = {
     attach(context, settings) {
       if (settings.blockPlacement) {
-        $(context).find('[data-drupal-selector="edit-blocks"]').once('block-highlight').each(function () {
-          const $container = $(this);
-          // Just scrolling the document.body will not work in Firefox. The html
-          // element is needed as well.
-          $('html, body').animate({
-            scrollTop: ($('.js-block-placed').offset().top - $container.offset().top) + $container.scrollTop(),
-          }, 500);
-        });
+        $(context)
+          .find('[data-drupal-selector="edit-blocks"]')
+          .once('block-highlight')
+          .each(function() {
+            const $container = $(this);
+            // Just scrolling the document.body will not work in Firefox. The html
+            // element is needed as well.
+            $('html, body').animate(
+              {
+                scrollTop:
+                  $('.js-block-placed').offset().top -
+                  $container.offset().top +
+                  $container.scrollTop(),
+              },
+              500,
+            );
+          });
       }
     },
   };
-}(jQuery, Drupal, Drupal.debounce));
+})(jQuery, Drupal, Drupal.debounce);