From 5273ca4c3bc887972b493c980d93f8f547014b58 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Tue, 27 Dec 2016 16:22:40 +0100 Subject: [PATCH] Force column break in IE11 / Firefox --- wcfsetup/install/files/js/WCF.User.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/wcfsetup/install/files/js/WCF.User.js b/wcfsetup/install/files/js/WCF.User.js index 478ad7e38d..cd9015dea9 100644 --- a/wcfsetup/install/files/js/WCF.User.js +++ b/wcfsetup/install/files/js/WCF.User.js @@ -586,6 +586,8 @@ WCF.User.QuickLogin = { loginForm.classList.add('loginFormLoginOnly'); } + var registrationBlock = elBySel('.loginFormRegister', loginForm); + var callbackOpen = function(event) { if (event instanceof Event) { event.preventDefault(); @@ -597,6 +599,20 @@ WCF.User.QuickLogin = { UiDialog.openStatic('loginForm', null, { title: WCF.Language.get('wcf.user.login') }); + + // The registration part should always be on the right + // but some browser (Firefox and IE) have a really bad + // support for forcing column breaks, requiring us to + // work around it by force pushing it to the right. + if (loginSection !== null && registrationBlock !== null) { + var loginOffset = loginSection.offsetTop; + var margin = 0; + while (loginOffset < (registrationBlock.offsetTop - 50)) { + // push the registration down by 100 pixel each time + margin += 100; + loginSection.style.setProperty('margin-bottom', margin + 'px', ''); + } + } }; var links = document.getElementsByClassName('loginLink'); -- 2.20.1