diff options
author | PayBas <contact@paybas.com> | 2014-06-25 13:28:54 +0200 |
---|---|---|
committer | PayBas <contact@paybas.com> | 2014-06-25 14:19:09 +0200 |
commit | 367c6aafca71c49f8a0d15e03096d3117860dc4e (patch) | |
tree | 8391f2fb1dd709788a166886bbb6ebaa2adee3ef /phpBB/assets/javascript | |
parent | 665742945f37a11a84ff3dc7190607a048fee485 (diff) | |
download | forums-367c6aafca71c49f8a0d15e03096d3117860dc4e.tar forums-367c6aafca71c49f8a0d15e03096d3117860dc4e.tar.gz forums-367c6aafca71c49f8a0d15e03096d3117860dc4e.tar.bz2 forums-367c6aafca71c49f8a0d15e03096d3117860dc4e.tar.xz forums-367c6aafca71c49f8a0d15e03096d3117860dc4e.zip |
[ticket/12662] Fix notifications dropdown positioning for RTL
PHPBB3-12662
Diffstat (limited to 'phpBB/assets/javascript')
-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'); } |