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:
1243514
)
Fixed dropdown escaping the document's top
author
Alexander Ebert
<ebert@woltlab.com>
Mon, 25 Jul 2016 14:00:37 +0000
(16:00 +0200)
committer
Alexander Ebert
<ebert@woltlab.com>
Mon, 25 Jul 2016 14:00:37 +0000
(16:00 +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 e5f0cd8d683fc74fb87e33e6aaf7c0e83dbb1681..27716dc37a47c7f24df13810c95d261acb858c1a 100755
(executable)
--- a/
wcfsetup/install/files/js/WCF.js
+++ b/
wcfsetup/install/files/js/WCF.js
@@
-1260,7
+1260,12
@@
WCF.Dropdown = {
}
}
else {
- if ($top + $menuDimensions.height > $(window).height() + $(document).scrollTop()) {
+ var menuHeight = $menuDimensions.height;
+ var scrollTop = $(document).scrollTop();
+
+ // only open towards the top if there is not enough space downwards
+ // *and* the dropdown does not overflow the document's top
+ if (($top + menuHeight > $(window).height() + scrollTop) && ($top + scrollTop) - menuHeight > 0) {
$bottom = $(window).height() - $dropdownOffsets.top + 10;
$top = 'auto';