mirror of
https://github.com/phpbb/phpbb.git
synced 2025-02-25 04:23:38 +01:00
[ticket/13726] Fix function that calculates responsive breadcrumbs width
Do not calculate width of hidden elements. Set minimum width to make sure breadcrumbs are always shown. PHPBB3-13726
This commit is contained in:
parent
499088b62f
commit
90b82d1a5f
@ -376,12 +376,19 @@ function parseDocument($container) {
|
||||
|
||||
function resize() {
|
||||
var width = 0,
|
||||
diff = $left.outerWidth(true) - $left.width();
|
||||
diff = $left.outerWidth(true) - $left.width(),
|
||||
minWidth = Math.max($this.width() / 3, 240),
|
||||
maxWidth;
|
||||
|
||||
$right.each(function() {
|
||||
width += $(this).outerWidth(true);
|
||||
var $this = $(this);
|
||||
if ($this.is(':visible')) {
|
||||
width += $this.outerWidth(true);
|
||||
}
|
||||
});
|
||||
$left.css('max-width', Math.floor($this.width() - width - diff) + 'px');
|
||||
|
||||
maxWidth = $this.width() - width - diff;
|
||||
$left.css('max-width', Math.floor(Math.max(maxWidth, minWidth)) + 'px');
|
||||
}
|
||||
|
||||
resize();
|
||||
|
Loading…
x
Reference in New Issue
Block a user