mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
[ticket/12265] Fix issue with dropdown being restricted by the width of parent
PHPBB3-12265
This commit is contained in:
parent
df8832455d
commit
ec145419ed
2 changed files with 13 additions and 2 deletions
|
@ -917,9 +917,10 @@ phpbb.toggleDropdown = function() {
|
||||||
// Check dimensions when showing dropdown
|
// Check dimensions when showing dropdown
|
||||||
// !visible because variable shows state of dropdown before it was toggled
|
// !visible because variable shows state of dropdown before it was toggled
|
||||||
if (!visible) {
|
if (!visible) {
|
||||||
|
var windowWidth = $(window).width();
|
||||||
|
|
||||||
options.dropdown.find('.dropdown-contents').each(function() {
|
options.dropdown.find('.dropdown-contents').each(function() {
|
||||||
var $this = $(this),
|
var $this = $(this);
|
||||||
windowWidth = $(window).width();
|
|
||||||
|
|
||||||
$this.css({
|
$this.css({
|
||||||
marginLeft: 0,
|
marginLeft: 0,
|
||||||
|
@ -937,6 +938,13 @@ phpbb.toggleDropdown = function() {
|
||||||
$this.css('margin-left', (windowWidth - offset - width - 2) + 'px');
|
$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
|
// Prevent event propagation
|
||||||
|
|
|
@ -470,6 +470,7 @@ ul.linklist.bulletin li.no-bulletin:before {
|
||||||
border: 1px solid transparent;
|
border: 1px solid transparent;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
padding: 9px 0 0;
|
padding: 9px 0 0;
|
||||||
|
margin-right: -500px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dropdown-container.topic-tools {
|
.dropdown-container.topic-tools {
|
||||||
|
@ -485,6 +486,8 @@ ul.linklist.bulletin li.no-bulletin:before {
|
||||||
.dropdown-left .dropdown, .nojs .rightside .dropdown {
|
.dropdown-left .dropdown, .nojs .rightside .dropdown {
|
||||||
left: auto;
|
left: auto;
|
||||||
right: 0;
|
right: 0;
|
||||||
|
margin-left: -500px;
|
||||||
|
margin-right: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dropdown-button-control .dropdown {
|
.dropdown-button-control .dropdown {
|
||||||
|
|
Loading…
Add table
Reference in a new issue