Fix disabling of scrolling when dialog is already open
authorTim Düsterhus <duesterhus@woltlab.com>
Sat, 18 Nov 2017 14:59:42 +0000 (15:59 +0100)
committerTim Düsterhus <duesterhus@woltlab.com>
Sun, 19 Nov 2017 22:57:42 +0000 (23:57 +0100)
wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Dialog.js

index e1be86efb115cb865036681349fd996306b4d2d0..6ab51b5e04dbadc917bf9b8516d1d15a57a6f1ba 100644 (file)
@@ -209,6 +209,12 @@ define(
                openStatic: function(id, html, options, createOnly) {
                        document.documentElement.classList.add('pageOverlayActive');
                        
+                       if (Environment.platform() !== 'desktop') {
+                               if (!this.isOpen(id)) {
+                                       UiScreen.scrollDisable();
+                               }
+                       }
+                       
                        if (_dialogs.has(id)) {
                                this._updateDialog(id, html);
                        }
@@ -246,8 +252,6 @@ define(
                        // are focused, this will freeze the screen and force Safari to scroll
                        // to the input field
                        if (Environment.platform() === 'ios') {
-                               UiScreen.scrollDisable();
-                               
                                window.setTimeout((function () {
                                        var input = elBySel('input, textarea', data.content);
                                        if (input !== null) {
@@ -255,9 +259,6 @@ define(
                                        }
                                }).bind(this), 200);
                        }
-                       else if (Environment.platform() !== 'desktop') {
-                               UiScreen.scrollDisable();
-                       }
                        
                        return data;
                },