From 77a963549590bec5819ab88aab7d947a130853f3 Mon Sep 17 00:00:00 2001 From: Vjacheslav Trushkin Date: Sun, 15 Sep 2013 01:19:45 +0300 Subject: [PATCH] [ticket/11552] Keep first nav row on same line PHPBB3-11552 --- phpBB/styles/prosilver/template/forum_fn.js | 22 +++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/phpBB/styles/prosilver/template/forum_fn.js b/phpBB/styles/prosilver/template/forum_fn.js index 316ab1e66f..fca0f0d701 100644 --- a/phpBB/styles/prosilver/template/forum_fn.js +++ b/phpBB/styles/prosilver/template/forum_fn.js @@ -442,6 +442,28 @@ function insert_single_user(formId, user) $('ul.linklist.bulletin li:first-child, ul.linklist.bulletin li.rightside:last-child').addClass('no-bulletin'); } + // Resize navigation block to keep all links on same line + $('.navlinks').each(function() { + var $this = $(this), + left = $this.children().not('.rightside'), + right = $this.children('.rightside'); + + if (left.length !== 1 || !right.length) return; + + function resize() { + var width = 0, + diff = left.outerWidth(true) - left.width(); + + right.each(function() { + width += $(this).outerWidth(true); + }); + left.css('max-width', Math.floor($this.width() - width - diff) + 'px'); + } + + resize(); + $(window).resize(resize); + }); + // Responsive breadcrumbs $('.breadcrumbs').each(function() { var $this = $(this),