From: Alexander Ebert Date: Sun, 2 Oct 2016 11:04:47 +0000 (+0200) Subject: Fixed quick options being visible for non-action messages X-Git-Tag: 3.0.0_Beta_2~25 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9c38465c51679be1ebbc5b04d00757971c50ea9f;p=GitHub%2FWoltLab%2FWCF.git Fixed quick options being visible for non-action messages --- diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Mobile.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Mobile.js index 6af62f2dba..708ef7ce1c 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Mobile.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Mobile.js @@ -175,18 +175,6 @@ define( } var navigation = elBySel('.jsMobileNavigation', message); - var quickOptions = elBySel('.messageQuickOptions', message); - - if (quickOptions) { - quickOptions.addEventListener(WCF_CLICK_EVENT, function (event) { - if (_enabled) { - event.preventDefault(); - event.stopPropagation(); - - navigation.classList.toggle('open'); - } - }); - } if (navigation) { navigation.addEventListener(WCF_CLICK_EVENT, function(event) { event.stopPropagation(); @@ -196,6 +184,23 @@ define( navigation.classList.remove('open'); }, 10); }); + + var quickOptions = elBySel('.messageQuickOptions', message); + if (quickOptions) { + if (navigation.childElementCount) { + quickOptions.addEventListener(WCF_CLICK_EVENT, function (event) { + if (_enabled) { + event.preventDefault(); + event.stopPropagation(); + + navigation.classList.toggle('open'); + } + }); + } + else { + elHide(quickOptions); + } + } } _knownMessages.add(message);