1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-02-24 20:13:22 +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:
cyberalien 2015-03-28 11:36:15 +02:00
parent 499088b62f
commit 90b82d1a5f

View File

@ -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();