From: Alexander Ebert Date: Wed, 31 Aug 2016 09:00:13 +0000 (+0200) Subject: Avoid issues with mutable variable X-Git-Tag: 3.0.0_Beta_1~388 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=95652251c81460b411dd0c364f93ca4c100bea94;p=GitHub%2FWoltLab%2FWCF.git Avoid issues with mutable variable --- diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Mobile.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Mobile.js index 1bbcb4cd98..e7b03dbe4b 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Mobile.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Mobile.js @@ -134,13 +134,6 @@ define( span.className = 'icon icon24 fa-ellipsis-v'; button.appendChild(span); - var list = elBySel('.buttonList', navigation); - list.addEventListener(WCF_CLICK_EVENT, function(event) { - event.stopPropagation(); - - navigation.classList.remove('open'); - }); - (function(navigation, button) { button.addEventListener(WCF_CLICK_EVENT, function(event) { event.preventDefault(); @@ -148,6 +141,13 @@ define( navigation.classList.toggle('open'); }); + + var list = elBySel('.buttonList', navigation); + list.addEventListener(WCF_CLICK_EVENT, function(event) { + event.stopPropagation(); + + navigation.classList.remove('open'); + }); })(navigation, button); navigation.insertBefore(button, navigation.firstChild);