From e8eb94deca6681d83dcdcbc3f7e05f961725050a Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Wed, 15 Nov 2017 13:23:11 +0100 Subject: [PATCH] Avoid early layout trashing --- .../install/files/js/WoltLabSuite/Core/Bootstrap.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Bootstrap.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Bootstrap.js index 8caf25c8bf..7a70c8b6e8 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Bootstrap.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Bootstrap.js @@ -70,8 +70,6 @@ define( UiDialog.setup(); UiTooltip.setup(); - new UiPageJumpToTop(); - // convert method=get into method=post var forms = elBySelAll('form[method=get]'); for (var i = 0, length = forms.length; i < length; i++) { @@ -84,12 +82,18 @@ define( }; } - // DEBUG ONLY var interval = 0; interval = window.setInterval(function() { if (typeof window.jQuery === 'function') { window.clearInterval(interval); + // the 'jump to top' button triggers style recalculation/layout, + // putting it at the end of the jQuery queue avoids trashing the + // layout too early and thus delaying the page initialization + window.jQuery(function() { + new UiPageJumpToTop(); + }); + window.jQuery.holdReady(false); } }, 20); -- 2.20.1