aboutsummaryrefslogtreecommitdiffstats
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
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
-rw-r--r--phpBB/assets/javascript/core.js12
-rw-r--r--phpBB/styles/prosilver/theme/common.css3
2 files changed, 13 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
diff --git a/phpBB/styles/prosilver/theme/common.css b/phpBB/styles/prosilver/theme/common.css
index 298d310ab1..8f32decd19 100644
--- a/phpBB/styles/prosilver/theme/common.css
+++ b/phpBB/styles/prosilver/theme/common.css
@@ -470,6 +470,7 @@ ul.linklist.bulletin li.no-bulletin:before {
border: 1px solid transparent;
border-radius: 5px;
padding: 9px 0 0;
+ margin-right: -500px;
}
.dropdown-container.topic-tools {
@@ -485,6 +486,8 @@ ul.linklist.bulletin li.no-bulletin:before {
.dropdown-left .dropdown, .nojs .rightside .dropdown {
left: auto;
right: 0;
+ margin-left: -500px;
+ margin-right: 0;
}
.dropdown-button-control .dropdown {