Force column break in IE11 / Firefox
authorAlexander Ebert <ebert@woltlab.com>
Tue, 27 Dec 2016 15:22:40 +0000 (16:22 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 27 Dec 2016 15:22:51 +0000 (16:22 +0100)
wcfsetup/install/files/js/WCF.User.js

index 478ad7e38da0f9a1c78668c4f1ec56a2a6b0c23b..cd9015dea95fe5f1cdad9d24903c87140dfe5561 100644 (file)
@@ -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');