mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Enable the save button by default when a query tool is opened with CREATE or other scripts. Fixes #4856
This commit is contained in:
committed by
Akshay Joshi
parent
33deacacee
commit
134c1802e7
@@ -2279,6 +2279,7 @@ define('tools.querytool', [
|
||||
}
|
||||
});
|
||||
|
||||
self.init_events();
|
||||
if (self.is_query_tool) {
|
||||
// Fetch the SQL for Scripts (eg: CREATE/UPDATE/DELETE/SELECT)
|
||||
// Call AJAX only if script type url is present
|
||||
@@ -2292,11 +2293,9 @@ define('tools.querytool', [
|
||||
if (res && res !== '') {
|
||||
self.gridView.query_tool_obj.setValue(res);
|
||||
}
|
||||
self.init_events();
|
||||
})
|
||||
.fail(function(jqx) {
|
||||
let msg = '';
|
||||
self.init_events();
|
||||
|
||||
msg = httpErrorHandler.handleQueryToolAjaxError(
|
||||
pgAdmin, self, jqx, null, [], false
|
||||
@@ -2306,13 +2305,10 @@ define('tools.querytool', [
|
||||
gettext('Error fetching SQL for script: %s.', msg)
|
||||
);
|
||||
});
|
||||
} else {
|
||||
self.init_events();
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Disable codemirror by setting readOnly option to true, background to dark, and cursor, hidden.
|
||||
self.init_events();
|
||||
self.gridView.query_tool_obj.setOption('readOnly', true);
|
||||
var cm = self.gridView.query_tool_obj.getWrapperElement();
|
||||
if (cm) {
|
||||
|
||||
Reference in New Issue
Block a user