From c5c1263ef2e86b4a09562ddd118f3dd8063e1e56 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Joshua=20R=C3=BCsweg?= Date: Mon, 6 Aug 2018 16:19:46 +0200 Subject: [PATCH] Make detection of mobile navigations more readable See #2508 --- .../install/files/js/WoltLabSuite/Core/Ui/Reaction/Handler.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Reaction/Handler.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Reaction/Handler.js index 62ab004788..bf322088a8 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Reaction/Handler.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Reaction/Handler.js @@ -109,7 +109,7 @@ define( return; } - if (elementData.reactButton.parentElement.parentElement.classList.contains('jsMobileNavigation')) { + if (elementData.reactButton.closest('.messageFooterGroup > .jsMobileNavigation')) { UiScreen.on('screen-sm-down', { match: this._enableMobileView.bind(this, elementData.reactButton, elementData.objectId), unmatch: this._disableMobileView.bind(this, elementData.reactButton, elementData.objectId), @@ -161,7 +161,7 @@ define( }, _rebuildMobileView: function(objectID) { - if (this._containers.get(objectID).reactButton.parentElement.parentElement.classList.contains('jsMobileNavigation')) { + if (this._containers.get(objectID).reactButton.closest('.messageFooterGroup > .jsMobileNavigation')) { var messageFooterGroup = this._containers.get(objectID).reactButton.parentElement.parentElement.parentElement; var button = elBySel('.mobileReactButton', messageFooterGroup); -- 2.20.1