From 618e371b0410bbca600bd63f123c7ee344b9af95 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Wed, 24 Aug 2016 13:21:25 +0200 Subject: [PATCH] Close menu on page option selection --- .../files/js/WoltLabSuite/Core/Ui/Page/Menu/Main.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Page/Menu/Main.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Page/Menu/Main.js index 2c98df817a..67ecd6f5a4 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Page/Menu/Main.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Page/Menu/Main.js @@ -35,6 +35,13 @@ define(['Core', 'Dom/Traverse', './Abstract'], function(Core, DomTraverse, UiPag // remove placeholder item elRemove(DomTraverse.childByClass(_list, 'jsMenuOverlayItemPlaceholder')); + + _list.addEventListener('click', (function (event) { + if (event.target !== _list) { + this.close(); + event.stopPropagation(); + } + }).bind(this)); } }, -- 2.20.1