1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

[ticket/12662] Fix notifications dropdown positioning for RTL

PHPBB3-12662
This commit is contained in:
PayBas
2014-06-25 13:28:54 +02:00
parent 665742945f
commit 367c6aafca
3 changed files with 16 additions and 2 deletions

View File

@@ -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');
}