From: Alexander Ebert Date: Wed, 24 Jun 2015 17:23:16 +0000 (+0200) Subject: Fixed `UI/Mobile` failing if no sidebar is present X-Git-Tag: 3.0.0_Beta_1~2256 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f0147588f16b62aac5fb2cf5508075ed8b3f4e59;p=GitHub%2FWoltLab%2FWCF.git Fixed `UI/Mobile` failing if no sidebar is present --- diff --git a/wcfsetup/install/files/js/WoltLab/WCF/UI/Mobile.js b/wcfsetup/install/files/js/WoltLab/WCF/UI/Mobile.js index 76de64c0eb..288a827221 100644 --- a/wcfsetup/install/files/js/WoltLab/WCF/UI/Mobile.js +++ b/wcfsetup/install/files/js/WoltLab/WCF/UI/Mobile.js @@ -44,7 +44,7 @@ define( deferSetup: true }); - if (Environment.browser() === 'microsoft' && _sidebar.clientWidth > 305) { + if (Environment.browser() === 'microsoft' && _sidebar !== null && _sidebar.clientWidth > 305) { this._fixSidebarIE(); } }, @@ -68,6 +68,8 @@ define( }, _fixSidebarIE: function() { + if (_sidebar === null) return; + // sidebar is rarely broken on IE9/IE10 _sidebar.style.setProperty('display', 'none'); _sidebar.style.removeProperty('display'); @@ -83,6 +85,8 @@ define( }, _initSidebarToggleButtons: function() { + if (_sidebar === null) return; + var sidebarPosition = (_main.classList.contains('sidebarOrientationLeft')) ? 'Left' : ''; sidebarPosition = (sidebarPosition) ? sidebarPosition : (_main.classList.contains('sidebarOrientationRight') ? 'Right' : '');