From 90b82d1a5f80b59edbe7335706f196e3d7feaf0e Mon Sep 17 00:00:00 2001 From: cyberalien Date: Sat, 28 Mar 2015 11:36:15 +0200 Subject: [PATCH] [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 --- phpBB/styles/prosilver/template/forum_fn.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/phpBB/styles/prosilver/template/forum_fn.js b/phpBB/styles/prosilver/template/forum_fn.js index aabc5679f6..a798229b77 100644 --- a/phpBB/styles/prosilver/template/forum_fn.js +++ b/phpBB/styles/prosilver/template/forum_fn.js @@ -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();