From: Alexander Ebert Date: Sun, 31 Jul 2016 12:41:54 +0000 (+0200) Subject: Fixed an issue w/ ACP mobile menu X-Git-Tag: 3.0.0_Beta_1~843 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=3ab88bee28e9b53a637774f1d90751f3a0414458;p=GitHub%2FWoltLab%2FWCF.git Fixed an issue w/ ACP mobile menu --- diff --git a/wcfsetup/install/files/js/WoltLab/WCF/Ui/Page/Menu/Main.js b/wcfsetup/install/files/js/WoltLab/WCF/Ui/Page/Menu/Main.js index eeba6ce800..64046563ff 100644 --- a/wcfsetup/install/files/js/WoltLab/WCF/Ui/Page/Menu/Main.js +++ b/wcfsetup/install/files/js/WoltLab/WCF/Ui/Page/Menu/Main.js @@ -9,11 +9,7 @@ define(['Core', 'Dom/Traverse', './Abstract'], function(Core, DomTraverse, UiPageMenuAbstract) { "use strict"; - var _container = elById('pageMainMenuMobilePageOptionsContainer'); - var _hasItems = null; - var _list = DomTraverse.childByClass(_container, 'menuOverlayItemList'); - var _navigationList = elBySel('.jsPageNavigationIcons'); - var _spacer = _container.nextElementSibling; + var _container = null, _hasItems = null, _list = null, _navigationList = null, _spacer = null; /** * @constructor @@ -31,8 +27,15 @@ define(['Core', 'Dom/Traverse', './Abstract'], function(Core, DomTraverse, UiPag '#pageHeader .mainMenu' ); - // remove placeholder item - elRemove(DomTraverse.childByClass(_list, 'jsMenuOverlayItemPlaceholder')); + _container = elById('pageMainMenuMobilePageOptionsContainer'); + if (_container !== null) { + _list = DomTraverse.childByClass(_container, 'menuOverlayItemList'); + _navigationList = elBySel('.jsPageNavigationIcons'); + _spacer = _container.nextElementSibling; + + // remove placeholder item + elRemove(DomTraverse.childByClass(_list, 'jsMenuOverlayItemPlaceholder')); + } }, open: function (event) { @@ -40,6 +43,10 @@ define(['Core', 'Dom/Traverse', './Abstract'], function(Core, DomTraverse, UiPag return false; } + if (_container === null) { + return true; + } + _hasItems = _navigationList.childElementCount > 0; if (_hasItems) {