From 90629da524294925632ef1f4036befb162f95981 Mon Sep 17 00:00:00 2001 From: Khushboo Vashi Date: Wed, 3 Jan 2018 13:36:49 +0000 Subject: [PATCH] Close user language preference drop down when it loses focus. Fixes #2956 --- web/pgadmin/preferences/static/js/preferences.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/web/pgadmin/preferences/static/js/preferences.js b/web/pgadmin/preferences/static/js/preferences.js index ca22a4cd6..635a6b70b 100644 --- a/web/pgadmin/preferences/static/js/preferences.js +++ b/web/pgadmin/preferences/static/js/preferences.js @@ -91,16 +91,18 @@ define('pgadmin.preferences', [ * Clear the existing html in the preferences content */ var content = $container.find('.preferences_content'); - content.empty(); - /* * We should clean up the existing controls. */ if (controls) { _.each(controls, function(c) { + if ('$sel' in c) { + if (c.$sel.data('select2').isOpen()) c.$sel.data('select2').close(); + } c.remove(); }); } + content.empty(); controls = []; /*