From 171a955ec9c67993c71657da82c5a629bc85b6b9 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Mon, 9 Mar 2015 23:06:11 +0100 Subject: [PATCH] Work-around for a glitch in Firefox and calculation issue in Chrome --- wcfsetup/install/files/js/WCF.js | 22 +++++++++++----------- wcfsetup/install/files/style/layout.less | 13 +++++++++---- 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/wcfsetup/install/files/js/WCF.js b/wcfsetup/install/files/js/WCF.js index f0ac00885b..cde4d8da72 100755 --- a/wcfsetup/install/files/js/WCF.js +++ b/wcfsetup/install/files/js/WCF.js @@ -12209,6 +12209,11 @@ WCF.Category.FlexibleCategoryList = Class.extend({ this._buildStructure(); + if (this._list.children('li').length < 2) { + this._list.addClass('flexibleCategoryListDisabled'); + return; + } + if ($.browser.chrome) { this._resize(); @@ -12251,19 +12256,14 @@ WCF.Category.FlexibleCategoryList = Class.extend({ var $items = this._list.children('li'); $items.each(function(index, item) { - if ($referenceOffset === -1) { + if ($referenceOffset === -1 || index + 1 === $items.length || $items[index + 1].offsetLeft != $referenceOffset) { + var $item = $(item); + var $height = $item.outerHeight(true); + var $offset = $item.position(); + + $realBottom = Math.max($realBottom, $offset.top + $height); $referenceOffset = item.offsetLeft; } - else { - if (index + 1 === $items.length || $items[index + 1].offsetLeft != $referenceOffset) { - var $item = $(item); - var $height = $item.outerHeight(true); - var $offset = $item.position(); - - $realBottom = Math.max($realBottom, $offset.top + $height); - $referenceOffset = item.offsetLeft; - } - } }); this._list.css('max-height', $realBottom + 'px'); diff --git a/wcfsetup/install/files/style/layout.less b/wcfsetup/install/files/style/layout.less index 364d4e1eeb..59d900612e 100644 --- a/wcfsetup/install/files/style/layout.less +++ b/wcfsetup/install/files/style/layout.less @@ -1177,7 +1177,7 @@ html[dir="rtl"] { } } - .flexibleCategoryList { + .flexibleCategoryList:not(.flexibleCategoryListDisabled) { /* WebKit */ -webkit-column-count: 2; @@ -1191,9 +1191,6 @@ html[dir="rtl"] { /* WebKit */ -webkit-column-break-inside: avoid; - /* Firefox */ - page-break-inside: avoid; - /* CSS 3 / Internet Explorer */ break-inside: avoid; @@ -1206,6 +1203,14 @@ html[dir="rtl"] { } } } + + /* Firefox */ + @-moz-document url-prefix() { + .flexibleCategoryList:not(.flexibleCategoryListDisabled) > li { + display: block; + overflow: hidden; + } + } } .sidebarNestedCategoryList { -- 2.20.1