From f0147588f16b62aac5fb2cf5508075ed8b3f4e59 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Wed, 24 Jun 2015 19:23:16 +0200 Subject: [PATCH] Fixed `UI/Mobile` failing if no sidebar is present --- wcfsetup/install/files/js/WoltLab/WCF/UI/Mobile.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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' : ''); -- 2.20.1