From 2451db87978c3bd43fb6350f990cc0e49c7928bb Mon Sep 17 00:00:00 2001 From: Aditya Toshniwal Date: Thu, 27 Jun 2019 10:37:50 -0400 Subject: [PATCH] Ensure the browser close confirmation is only shown when closing a Query Tool which is running in a separate browser tab. Fixes #4403 --- docs/en_US/release_notes_4_10.rst | 2 ++ web/pgadmin/tools/sqleditor/static/js/sqleditor.js | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/en_US/release_notes_4_10.rst b/docs/en_US/release_notes_4_10.rst index bbb25b6f3..b557148c3 100644 --- a/docs/en_US/release_notes_4_10.rst +++ b/docs/en_US/release_notes_4_10.rst @@ -13,3 +13,5 @@ New features Bug fixes ********* + +| `Bug #4403 `_ - Ensure the browser close confirmation is only shown when closing a Query Tool which is running in a separate browser tab. \ No newline at end of file diff --git a/web/pgadmin/tools/sqleditor/static/js/sqleditor.js b/web/pgadmin/tools/sqleditor/static/js/sqleditor.js index ef468f63a..8bf041f68 100644 --- a/web/pgadmin/tools/sqleditor/static/js/sqleditor.js +++ b/web/pgadmin/tools/sqleditor/static/js/sqleditor.js @@ -584,8 +584,6 @@ define('tools.querytool', [ }; }); - pgBrowser.bind_beforeunload(); - /* If the screen width is small and we hover over the Explain Options, * the submenu goes behind the screen on the right side. * Below logic will make it appear on the left. @@ -631,6 +629,7 @@ define('tools.querytool', [ * instead, a poller is set up who will check */ if(self.preferences.new_browser_tab) { + pgBrowser.bind_beforeunload(); setInterval(()=>{ if(window.opener.pgAdmin) { self.reflectPreferences();