diff options
| author | cyberalien <cyberalien@gmail.com> | 2015-03-28 11:36:15 +0200 | 
|---|---|---|
| committer | cyberalien <cyberalien@gmail.com> | 2015-03-28 11:36:15 +0200 | 
| commit | 90b82d1a5f80b59edbe7335706f196e3d7feaf0e (patch) | |
| tree | 74f58583291f102a52d9d69e2e187f7547c2f7f0 | |
| parent | 499088b62f686482fd9419be83baef9a7c5ab1c2 (diff) | |
| download | forums-90b82d1a5f80b59edbe7335706f196e3d7feaf0e.tar forums-90b82d1a5f80b59edbe7335706f196e3d7feaf0e.tar.gz forums-90b82d1a5f80b59edbe7335706f196e3d7feaf0e.tar.bz2 forums-90b82d1a5f80b59edbe7335706f196e3d7feaf0e.tar.xz forums-90b82d1a5f80b59edbe7335706f196e3d7feaf0e.zip | |
[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
| -rw-r--r-- | phpBB/styles/prosilver/template/forum_fn.js | 13 | 
1 files 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(); | 
