Hi,

PFA patch to fix the issue where user were not able to execute query by
pressing F5 key after cancelling the query.
RM#3054

Also fixed the similar issue when user press open/save dialog & clear
editor window options.

--
Regards,
Murtuza Zabuawala
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
diff --git a/web/pgadmin/tools/sqleditor/static/js/sqleditor.js 
b/web/pgadmin/tools/sqleditor/static/js/sqleditor.js
index 94151e7..8b86617 100644
--- a/web/pgadmin/tools/sqleditor/static/js/sqleditor.js
+++ b/web/pgadmin/tools/sqleditor/static/js/sqleditor.js
@@ -1539,6 +1539,7 @@ define('tools.querytool', [
           function() {
             // Do nothing as user do not want to save, just continue
             self.query_tool_obj.setValue('');
+            setTimeout(() => { self.query_tool_obj.focus(); }, 200);
           },
           function() {
             return true;
@@ -1568,6 +1569,7 @@ define('tools.querytool', [
           if (self.history_collection) {
             self.history_collection.reset();
           }
+          setTimeout(() => { self.query_tool_obj.focus(); }, 200);
         },
         function() {
           return true;
@@ -2805,6 +2807,7 @@ define('tools.querytool', [
 
             // Update the flag as new content is just loaded.
             self.is_query_changed = false;
+            setTimeout(() => { self.gridView.query_tool_obj.focus(); }, 200);
           },
           error: function(e) {
             var errmsg = $.parseJSON(e.responseText).errormsg;
@@ -2845,6 +2848,7 @@ define('tools.querytool', [
 
               // Update the flag as query is already saved.
               self.is_query_changed = false;
+              setTimeout(() => { self.gridView.query_tool_obj.focus(); }, 200);
             }
             self.trigger('pgadmin-sqleditor:loading-icon:hide');
             if (self.close_on_save) {
@@ -3556,6 +3560,8 @@ define('tools.querytool', [
               self.disable_tool_buttons(false);
               alertify.alert(gettext('Cancel Query Error'), res.data.result);
             }
+            is_query_running = false;
+            setTimeout(() => { self.gridView.query_tool_obj.focus(); }, 200);
           },
           error: function(e) {
             self.disable_tool_buttons(false);

Reply via email to