From caa67386524727a5a34b677d6a1d82fa6c412207 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Mon, 27 May 2013 03:13:16 +0200 Subject: [PATCH] Opening an overlay in mobile devices automatically scrolls to top --- wcfsetup/install/files/js/WCF.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/wcfsetup/install/files/js/WCF.js b/wcfsetup/install/files/js/WCF.js index 30a665d80f..dfebe12c00 100755 --- a/wcfsetup/install/files/js/WCF.js +++ b/wcfsetup/install/files/js/WCF.js @@ -8387,6 +8387,12 @@ $.widget('ui.wcfDialog', { * Renders this dialog, should be called whenever content is updated. */ render: function() { + // check if this if dialog was previously hidden and container is fixed + // at 0px (mobile optimization), in this case scroll to top + if (!this._container.is(':visible') && this._container.css('top') === '0px') { + window.scrollTo(0, 0); + } + // force dialog and it's contents to be visible this._container.show(); this._content.children().show(); -- 2.20.1