diff options
Diffstat (limited to 'phpBB/assets/javascript/core.js')
-rw-r--r-- | phpBB/assets/javascript/core.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/phpBB/assets/javascript/core.js b/phpBB/assets/javascript/core.js index 785aa141f0..02fb3ed08d 100644 --- a/phpBB/assets/javascript/core.js +++ b/phpBB/assets/javascript/core.js @@ -1301,6 +1301,20 @@ phpbb.toggleDropdown = function() { if (direction == 'left') { options.dropdown.css('margin-left', '-' + freeSpace + 'px'); + + // Try to position the notification dropdown correctly in RTL-responsive mode + if (options.dropdown.hasClass('dropdown-extended')) { + var contentWidth, + fullFreeSpace = freeSpace + parent.outerWidth(); + + options.dropdown.find('.dropdown-contents').each(function() { + contentWidth = parseInt($(this).outerWidth()); + $(this).css({marginLeft: 0, left: 0}); + }); + + var maxOffset = Math.min(contentWidth, fullFreeSpace) + 'px'; + options.dropdown.css({'width': maxOffset, 'margin-left': '-' + maxOffset}); + } } else { options.dropdown.css('margin-right', '-' + (windowWidth + freeSpace) + 'px'); } |