Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / core / modules / block / js / block.admin.es6.js
index ee4ec0844d0bbe0e1085792988e958d003d169ca..780ea12e2e70c9e3f07eccbfe86959f46a54f1f5 100644 (file)
@@ -24,7 +24,7 @@
     attach(context, settings) {
       const $input = $('input.block-filter-text').once('block-filter-text');
       const $table = $($input.attr('data-element'));
-      let $filter_rows;
+      let $filterRows;
 
       /**
        * Filters the block list.
 
         // Filter if the length of the query is at least 2 characters.
         if (query.length >= 2) {
-          $filter_rows.each(toggleBlockEntry);
+          $filterRows.each(toggleBlockEntry);
           Drupal.announce(
             Drupal.formatPlural(
               $table.find('tr:visible').length - 1,
               '1 block is available in the modified list.',
-              '@count blocks are available in the modified list.'
-            )
+              '@count blocks are available in the modified list.',
+            ),
           );
         }
         else {
-          $filter_rows.each(function (index) {
+          $filterRows.each(function (index) {
             $(this).parent().parent().show();
           });
         }
       }
 
       if ($table.length) {
-        $filter_rows = $table.find('div.block-filter-text-source');
+        $filterRows = $table.find('div.block-filter-text-source');
         $input.on('keyup', debounce(filterBlockList, 200));
       }
     },
@@ -91,7 +91,7 @@
           // 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(),
+            scrollTop: ($('.js-block-placed').offset().top - $container.offset().top) + $container.scrollTop(),
           }, 500);
         });
       }