1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-28 04:20:32 +02:00

[ticket/12265] Fix issue with dropdown being restricted by the width of parent

PHPBB3-12265
This commit is contained in:
Cesar G
2014-04-10 05:18:57 -07:00
parent df8832455d
commit ec145419ed
2 changed files with 13 additions and 2 deletions

View File

@@ -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