From 95652251c81460b411dd0c364f93ca4c100bea94 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Wed, 31 Aug 2016 11:00:13 +0200 Subject: [PATCH] Avoid issues with mutable variable --- .../files/js/WoltLabSuite/Core/Ui/Mobile.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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); -- 2.20.1