[pgAdmin][RM4896] Close Open/Save Dialog in query tool on Escape key

Nagesh Dhope <[email protected]> Fri, 8 Nov 2019 16:17:47 +0530
Newsgroups gmane.comp.db.postgresql.pgadmin.devel
Message-ID <CAA3zdZp3H_Bg3MwnQkCusgPigpJHkcsO=Cr45ezDn+cRiDxotg@mail.gmail.com>
Hi Hackers,
Please find an attached patch for closing Open/Save dialog in the query
tool on the escape key.

-- 
Thanks,
Nagesh
RM4896.patch (application/octet-stream, 648 B)
diff --git a/web/pgadmin/tools/sqleditor/static/js/sqleditor.js b/web/pgadmin/tools/sqleditor/static/js/sqleditor.js
index ee370a2..70d4bd3 100644
--- a/web/pgadmin/tools/sqleditor/static/js/sqleditor.js
+++ b/web/pgadmin/tools/sqleditor/static/js/sqleditor.js
@@ -2256,7 +2256,7 @@ define('tools.querytool', [
          * loses focus and events don't work.
          */
         $(window).on('keydown', (e)=>{
-          if(self.gridView.keyAction) {
+          if(($('.sql-editor').find(e.target).length !== 0 || e.target == $('body.wcDesktop')[0]) && self.gridView.keyAction) {
             self.gridView.keyAction(e);
           }
         });