From ec145419eddce662e0afe050f14f0f690ecf40e2 Mon Sep 17 00:00:00 2001 From: Cesar G Date: Thu, 10 Apr 2014 05:18:57 -0700 Subject: [PATCH] [ticket/12265] Fix issue with dropdown being restricted by the width of parent PHPBB3-12265 --- phpBB/assets/javascript/core.js | 12 ++++++++++-- phpBB/styles/prosilver/theme/common.css | 3 +++ 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 {