From d4de76662ff83e26ebc59092be135a10255e9a4a Mon Sep 17 00:00:00 2001 From: Harrys Ravalomanana Date: Wed, 13 Nov 2019 18:37:02 +0400 Subject: [PATCH] PHRAS-2760 #comment close submenu on click a div out of this #time 1h --- templates/web/common/menubar.html.twig | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/templates/web/common/menubar.html.twig b/templates/web/common/menubar.html.twig index 3821f42e79..772a86c497 100644 --- a/templates/web/common/menubar.html.twig +++ b/templates/web/common/menubar.html.twig @@ -302,8 +302,18 @@ $(document).ready(function () { $('body').on('click', '#help-trigger', function (event) { $('#mainMenu .helpcontextmenu').toggleClass('shown'); - console.log('mety'); + }); + + $(document).on('click', function (e) { + if($('#mainMenu .helpcontextmenu').hasClass('shown')) { + var $this = $(e.target); + if ($this.closest('#mainMenu .helpcontextmenu.shown, .help-trigger').length == 0 && $this[0].id != "toggle") { + $('#mainMenu .helpcontextmenu').removeClass('shown'); + } + } + }); + // var key = 'help'; var configurationSettingLinks = {{ configuration|json_encode|raw }}; //seperate array based on location of link