Close menu on page option selection
authorAlexander Ebert <ebert@woltlab.com>
Wed, 24 Aug 2016 11:21:25 +0000 (13:21 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Wed, 24 Aug 2016 11:21:34 +0000 (13:21 +0200)
wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Page/Menu/Main.js

index 2c98df817a4f13a9baa63251d08b227e92e64930..67ecd6f5a4c36ee685e0336a0dbc9106ae1fc002 100644 (file)
@@ -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));
                        }
                },