aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/assets/javascript
diff options
context:
space:
mode:
authorCesar G <prototech91@gmail.com>2014-04-10 05:18:57 -0700
committerCesar G <prototech91@gmail.com>2014-04-15 08:56:34 -0700
commitec145419eddce662e0afe050f14f0f690ecf40e2 (patch)
tree42ad4ae01486f51cc9c3e0684422bff8668fd177 /phpBB/assets/javascript
parentdf8832455d48a8dd741c5d62f62071562b6615b4 (diff)
downloadforums-ec145419eddce662e0afe050f14f0f690ecf40e2.tar
forums-ec145419eddce662e0afe050f14f0f690ecf40e2.tar.gz
forums-ec145419eddce662e0afe050f14f0f690ecf40e2.tar.bz2
forums-ec145419eddce662e0afe050f14f0f690ecf40e2.tar.xz
forums-ec145419eddce662e0afe050f14f0f690ecf40e2.zip
[ticket/12265] Fix issue with dropdown being restricted by the width of parent
PHPBB3-12265
Diffstat (limited to 'phpBB/assets/javascript')
-rw-r--r--phpBB/assets/javascript/core.js12
1 files changed, 10 insertions, 2 deletions
diff --git a/phpBB/assets/javascript/core.js b/phpBB/assets/javascript/core.js
index ac866f7c78..759d4f3229 100644
--- a/phpBB/assets/javascript/core.js
+++ b/phpBB/assets/javascript/core.js
@@ -917,9 +917,10 @@ phpbb.toggleDropdown = function() {
// Check dimensions when showing dropdown
// !visible because variable shows state of dropdown before it was toggled
if (!visible) {
+ var windowWidth = $(window).width();
+
options.dropdown.find('.dropdown-contents').each(function() {
- var $this = $(this),
- windowWidth = $(window).width();
+ var $this = $(this);
$this.css({
marginLeft: 0,
@@ -937,6 +938,13 @@ phpbb.toggleDropdown = function() {
$this.css('margin-left', (windowWidth - offset - width - 2) + 'px');
}
});
+ var freeSpace = parent.offset().left - 4;
+
+ if (direction == 'left') {
+ options.dropdown.css('margin-left', '-' + freeSpace + 'px');
+ } else {
+ options.dropdown.css('margin-right', '-' + (windowWidth + freeSpace) + 'px');
+ }
}
// Prevent event propagation