diff --git a/core/.eslintrc.jquery.json b/core/.eslintrc.jquery.json index e53f784f2d77c404deeb04e0cc027f0c1e2bec9b..e0317d173eafeb19abffffd737ef496ca31e658f 100644 --- a/core/.eslintrc.jquery.json +++ b/core/.eslintrc.jquery.json @@ -5,7 +5,7 @@ "rules": { "jquery/no-ajax": 0, "jquery/no-ajax-events": 2, - "jquery/no-animate": 0, + "jquery/no-animate": 2, "jquery/no-attr": 0, "jquery/no-bind": 2, "jquery/no-class": 0, @@ -53,4 +53,4 @@ "jquery/no-when": 2, "jquery/no-wrap": 0 } -} +} \ No newline at end of file diff --git a/core/misc/ajax.js b/core/misc/ajax.js index 7483108f6b36cd1c4ef7e042ed93bf6641d1ee73..c476f204914c0d15d8ae458839034ac08cf872ee 100644 --- a/core/misc/ajax.js +++ b/core/misc/ajax.js @@ -1852,9 +1852,13 @@ while ($(scrollTarget).scrollTop() === 0 && $(scrollTarget).parent()) { scrollTarget = $(scrollTarget).parent(); } + // Only scroll upward. if (offset.top - 10 < $(scrollTarget).scrollTop()) { - $(scrollTarget).animate({ scrollTop: offset.top - 10 }, 500); + scrollTarget.get(0).scrollTo({ + top: offset.top - 10, + behavior: 'smooth', + }); } }, }; diff --git a/core/modules/block/js/block.admin.js b/core/modules/block/js/block.admin.js index 055f2fccba56173ab7bb35119d241b4e92b5ce1c..fee71251f6b5bcd82e3b334eee82482f3e7f677b 100644 --- a/core/modules/block/js/block.admin.js +++ b/core/modules/block/js/block.admin.js @@ -91,17 +91,13 @@ context, ).forEach((container) => { const $container = $(container); - // 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, - ); + window.scrollTo({ + top: + $('.js-block-placed').offset().top - + $container.offset().top + + $container.scrollTop(), + behavior: 'smooth', + }); }); } }, diff --git a/core/modules/ckeditor5/js/ckeditor5.js b/core/modules/ckeditor5/js/ckeditor5.js index bd5f3facdf9c19f252461880e24eea078a0f5dbe..7bace8702c0f55fe3ef7ae061cd1f22c9a5bfcb6 100644 --- a/core/modules/ckeditor5/js/ckeditor5.js +++ b/core/modules/ckeditor5/js/ckeditor5.js @@ -651,12 +651,18 @@ // Respond to new dialogs that are opened by CKEditor, closing the AJAX loader. $(window).on('dialog:beforecreate', () => { - $('.ckeditor5-dialog-loading').animate( - { top: '-40px' }, - function removeDialogLoading() { - $(this).remove(); - }, - ); + const dialogLoading = document.querySelector('.ckeditor5-dialog-loading'); + + if (dialogLoading) { + dialogLoading.addEventListener( + 'transitionend', + function removeDialogLoading() { + dialogLoading.remove(); + }, + ); + dialogLoading.style.transition = 'top 0.5s ease'; + dialogLoading.style.top = '-40px'; + } }); // Respond to dialogs that are saved, sending data back to CKEditor.