projects
/
GitHub
/
WoltLab
/
WCF.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cf06c4f
)
Opening an overlay in mobile devices automatically scrolls to top
author
Alexander Ebert
<ebert@woltlab.com>
Mon, 27 May 2013 01:13:16 +0000
(
03:13
+0200)
committer
Alexander Ebert
<ebert@woltlab.com>
Mon, 27 May 2013 01:13:16 +0000
(
03:13
+0200)
wcfsetup/install/files/js/WCF.js
patch
|
blob
|
blame
|
history
diff --git
a/wcfsetup/install/files/js/WCF.js
b/wcfsetup/install/files/js/WCF.js
index 30a665d80f8958ae24a545fc7b364596fe2aaf95..dfebe12c00fdd26eeb9322264cf07c365bc75d16 100755
(executable)
--- 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();