aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/assets
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/assets')
-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 4920a1167f..a42701877b 100644
--- a/phpBB/assets/javascript/core.js
+++ b/phpBB/assets/javascript/core.js
@@ -918,9 +918,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,
@@ -938,6 +939,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