From 7ac7d09e14b79c0a0b0bf1290e37190ed377fadc Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Fri, 2 Sep 2016 10:51:11 +0200 Subject: [PATCH] Disables shadow links for screen-md --- .../files/js/WoltLabSuite/Core/Ui/Mobile.js | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Mobile.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Mobile.js index e7b03dbe4b..6af62f2dba 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Mobile.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Mobile.js @@ -54,6 +54,12 @@ define( unmatch: this.disable.bind(this), setup: this._init.bind(this) }); + + UiScreen.on('screen-sm-down', { + match: this.enableShadow.bind(this), + unmatch: this.disableShadow.bind(this), + setup: this.enableShadow.bind(this) + }); }, /** @@ -66,7 +72,12 @@ define( _pageMenuMain.enable(); _pageMenuUser.enable(); } - + }, + + /** + * Enables shadow links for larger click areas on messages. + */ + enableShadow: function () { if (_messageGroups) this.rebuildShadow(_messageGroups, '.messageGroupLink'); }, @@ -80,7 +91,12 @@ define( _pageMenuMain.disable(); _pageMenuUser.disable(); } - + }, + + /** + * Disables shadow links. + */ + disableShadow: function () { if (_messageGroups) this.removeShadow(_messageGroups); }, @@ -97,8 +113,6 @@ define( this._initButtonGroupNavigation(); this._initMessages(); }).bind(this)); - - if (_messageGroups) this.rebuildShadow(_messageGroups, '.messageGroupLink'); }, _initSearchBar: function() { -- 2.20.1