From 9c38465c51679be1ebbc5b04d00757971c50ea9f Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Sun, 2 Oct 2016 13:04:47 +0200 Subject: [PATCH] Fixed quick options being visible for non-action messages --- .../files/js/WoltLabSuite/Core/Ui/Mobile.js | 29 +++++++++++-------- 1 file changed, 17 insertions(+), 12 deletions(-) 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); -- 2.20.1