mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Avoid unnecessary redraws of the SQL pane.
This commit is contained in:
@@ -45,14 +45,16 @@ function(_, $, pgBrowser) {
|
|||||||
sql = '-- No SQL generated for the selected object.';
|
sql = '-- No SQL generated for the selected object.';
|
||||||
if (node.hasSQL) {
|
if (node.hasSQL) {
|
||||||
|
|
||||||
sql = '-- Please wait while we fetch the SQL from the server.';
|
sql = '';
|
||||||
var url = node.generate_url(item, 'sql', data, true);
|
var url = node.generate_url(item, 'sql', data, true);
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: url,
|
url: url,
|
||||||
type:'GET',
|
type:'GET',
|
||||||
success: function(res) {
|
success: function(res) {
|
||||||
|
if (pgAdmin.Browser.editor.getValue() != res) {
|
||||||
pgAdmin.Browser.editor.setValue(res);
|
pgAdmin.Browser.editor.setValue(res);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
error: function() {
|
error: function() {
|
||||||
// TODO:: Report this
|
// TODO:: Report this
|
||||||
@@ -60,7 +62,9 @@ function(_, $, pgBrowser) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (sql != '') {
|
||||||
pgAdmin.Browser.editor.setValue(sql);
|
pgAdmin.Browser.editor.setValue(sql);
|
||||||
|
}
|
||||||
}, 400);
|
}, 400);
|
||||||
},
|
},
|
||||||
sqlPanelVisibilityChanged: function(panel) {
|
sqlPanelVisibilityChanged: function(panel) {
|
||||||
|
|||||||
Reference in New Issue
Block a user