From e70e39e3f74644a2e6714b4084e1cd5563877701 Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Wed, 23 Sep 2020 13:40:49 +0300 Subject: [PATCH] The language selection popup will disappear if the users clicks anywhere on the screen (#815). --- assets/js/general_functions.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/assets/js/general_functions.js b/assets/js/general_functions.js index 23155942..8e82848a 100755 --- a/assets/js/general_functions.js +++ b/assets/js/general_functions.js @@ -264,7 +264,9 @@ window.GeneralFunctions = window.GeneralFunctions || {}; trigger: 'manual' }); - $element.on('click', function () { + $element.on('click', function (event) { + event.stopPropagation(); + if ($('#language-list').length === 0) { $(this).popover('show'); } else { @@ -289,6 +291,10 @@ window.GeneralFunctions = window.GeneralFunctions || {}; }) .fail(GeneralFunctions.ajaxFailureHandler); }); + + $(document).on('click', function() { + $element.popover('hide'); + }); }; /**