From: Joshua Rüsweg Date: Mon, 6 Aug 2018 14:19:46 +0000 (+0200) Subject: Make detection of mobile navigations more readable X-Git-Tag: 5.2.0_Alpha_1~364^2~101^2~5 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c5c1263ef2e86b4a09562ddd118f3dd8063e1e56;p=GitHub%2FWoltLab%2FWCF.git Make detection of mobile navigations more readable See #2508 --- 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);