From: Alexander Ebert Date: Tue, 27 Dec 2016 15:22:40 +0000 (+0100) Subject: Force column break in IE11 / Firefox X-Git-Tag: 3.0.0_RC_3~27 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5273ca4c3bc887972b493c980d93f8f547014b58;p=GitHub%2FWoltLab%2FWCF.git Force column break in IE11 / Firefox --- 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');