diff --git a/core/modules/block/js/block.admin.js b/core/modules/block/js/block.admin.js index f22d547..5c657d4 100644 --- a/core/modules/block/js/block.admin.js +++ b/core/modules/block/js/block.admin.js @@ -74,10 +74,14 @@ Drupal.behaviors.blockFilterByText = { Drupal.behaviors.blockHighlightPlacement = { attach: function (context, settings) { if (settings.blockPlacement) { - var $container = $('#blocks'); - $('html, body').animate({ - scrollTop: $('#block-placed').offset().top - $container.offset().top + $container.scrollTop() - }, 500); + $('#blocks').once('block-highlight', function () { + var $container = $(this); + // Just scrolling the document.body will not work in Firefox. The html + // element is needed as well. + $('html, body').animate({ + scrollTop: $('#block-placed').offset().top - $container.offset().top + $container.scrollTop() + }, 500); + }); } } };