Enable/disable the Download button with the Execute button.
parent
73b144c45c
commit
0766b17726
|
@ -172,6 +172,7 @@ class ExecuteQuery {
|
||||||
this.loadingScreen.show('Running query...');
|
this.loadingScreen.show('Running query...');
|
||||||
|
|
||||||
$('#btn-flash').prop('disabled', true);
|
$('#btn-flash').prop('disabled', true);
|
||||||
|
$('#btn-download').prop('disabled', true);
|
||||||
|
|
||||||
this.sqlServerObject.query_start_time = new Date();
|
this.sqlServerObject.query_start_time = new Date();
|
||||||
if (typeof sqlStatement === 'object') {
|
if (typeof sqlStatement === 'object') {
|
||||||
|
|
|
@ -1174,6 +1174,7 @@ define('tools.querytool', [
|
||||||
self.handler.fetching_rows = true;
|
self.handler.fetching_rows = true;
|
||||||
|
|
||||||
$('#btn-flash').prop('disabled', true);
|
$('#btn-flash').prop('disabled', true);
|
||||||
|
$('#btn-download').prop('disabled', true);
|
||||||
|
|
||||||
if (fetch_all) {
|
if (fetch_all) {
|
||||||
self.handler.trigger(
|
self.handler.trigger(
|
||||||
|
@ -1197,6 +1198,7 @@ define('tools.querytool', [
|
||||||
.done(function(res) {
|
.done(function(res) {
|
||||||
self.handler.has_more_rows = res.data.has_more_rows;
|
self.handler.has_more_rows = res.data.has_more_rows;
|
||||||
$('#btn-flash').prop('disabled', false);
|
$('#btn-flash').prop('disabled', false);
|
||||||
|
$('#btn-download').prop('disabled', false);
|
||||||
self.handler.trigger('pgadmin-sqleditor:loading-icon:hide');
|
self.handler.trigger('pgadmin-sqleditor:loading-icon:hide');
|
||||||
self.update_grid_data(res.data.result);
|
self.update_grid_data(res.data.result);
|
||||||
self.handler.fetching_rows = false;
|
self.handler.fetching_rows = false;
|
||||||
|
@ -1206,6 +1208,7 @@ define('tools.querytool', [
|
||||||
})
|
})
|
||||||
.fail(function(e) {
|
.fail(function(e) {
|
||||||
$('#btn-flash').prop('disabled', false);
|
$('#btn-flash').prop('disabled', false);
|
||||||
|
$('#btn-download').prop('disabled', false);
|
||||||
self.handler.trigger('pgadmin-sqleditor:loading-icon:hide');
|
self.handler.trigger('pgadmin-sqleditor:loading-icon:hide');
|
||||||
self.handler.has_more_rows = false;
|
self.handler.has_more_rows = false;
|
||||||
self.handler.fetching_rows = false;
|
self.handler.fetching_rows = false;
|
||||||
|
@ -2151,6 +2154,7 @@ define('tools.querytool', [
|
||||||
);
|
);
|
||||||
|
|
||||||
$('#btn-flash').prop('disabled', true);
|
$('#btn-flash').prop('disabled', true);
|
||||||
|
$('#btn-download').prop('disabled', true);
|
||||||
|
|
||||||
self.trigger(
|
self.trigger(
|
||||||
'pgadmin-sqleditor:loading-icon:message',
|
'pgadmin-sqleditor:loading-icon:message',
|
||||||
|
@ -2362,6 +2366,7 @@ define('tools.querytool', [
|
||||||
// Hide the loading icon
|
// Hide the loading icon
|
||||||
self.trigger('pgadmin-sqleditor:loading-icon:hide');
|
self.trigger('pgadmin-sqleditor:loading-icon:hide');
|
||||||
$('#btn-flash').prop('disabled', false);
|
$('#btn-flash').prop('disabled', false);
|
||||||
|
$('#btn-download').prop('disabled', false);
|
||||||
}.bind(self)
|
}.bind(self)
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
@ -2534,6 +2539,7 @@ define('tools.querytool', [
|
||||||
|
|
||||||
if (status != 'Busy') {
|
if (status != 'Busy') {
|
||||||
$('#btn-flash').prop('disabled', false);
|
$('#btn-flash').prop('disabled', false);
|
||||||
|
$('#btn-download').prop('disabled', false);
|
||||||
self.trigger('pgadmin-sqleditor:loading-icon:hide');
|
self.trigger('pgadmin-sqleditor:loading-icon:hide');
|
||||||
self.gridView.history_collection.add({
|
self.gridView.history_collection.add({
|
||||||
'status': status,
|
'status': status,
|
||||||
|
@ -2787,6 +2793,7 @@ define('tools.querytool', [
|
||||||
} else {
|
} else {
|
||||||
// Something went wrong while saving data on the db server
|
// Something went wrong while saving data on the db server
|
||||||
$('#btn-flash').prop('disabled', false);
|
$('#btn-flash').prop('disabled', false);
|
||||||
|
$('#btn-download').prop('disabled', false);
|
||||||
$('.sql-editor-message').text(res.data.result);
|
$('.sql-editor-message').text(res.data.result);
|
||||||
var err_msg = S(gettext('%s.')).sprintf(res.data.result).value();
|
var err_msg = S(gettext('%s.')).sprintf(res.data.result).value();
|
||||||
alertify.error(err_msg, 20);
|
alertify.error(err_msg, 20);
|
||||||
|
@ -3398,7 +3405,6 @@ define('tools.querytool', [
|
||||||
$('#btn-file-menu-dropdown').prop('disabled', disabled);
|
$('#btn-file-menu-dropdown').prop('disabled', disabled);
|
||||||
$('#btn-find').prop('disabled', disabled);
|
$('#btn-find').prop('disabled', disabled);
|
||||||
$('#btn-find-menu-dropdown').prop('disabled', disabled);
|
$('#btn-find-menu-dropdown').prop('disabled', disabled);
|
||||||
$('#btn-download').prop('disabled', disabled);
|
|
||||||
if (this.is_query_tool) {
|
if (this.is_query_tool) {
|
||||||
// Cancel query tool needs opposite behaviour
|
// Cancel query tool needs opposite behaviour
|
||||||
$('#btn-cancel-query').prop('disabled', !disabled);
|
$('#btn-cancel-query').prop('disabled', !disabled);
|
||||||
|
@ -3510,6 +3516,7 @@ define('tools.querytool', [
|
||||||
if(!_.isUndefined(self.download_csv_obj)) {
|
if(!_.isUndefined(self.download_csv_obj)) {
|
||||||
self.download_csv_obj.abort();
|
self.download_csv_obj.abort();
|
||||||
$('#btn-flash').prop('disabled', false);
|
$('#btn-flash').prop('disabled', false);
|
||||||
|
$('#btn-download').prop('disabled', false);
|
||||||
self.trigger(
|
self.trigger(
|
||||||
'pgadmin-sqleditor:loading-icon:hide');
|
'pgadmin-sqleditor:loading-icon:hide');
|
||||||
}
|
}
|
||||||
|
@ -3549,6 +3556,7 @@ define('tools.querytool', [
|
||||||
beforeSend: function() {
|
beforeSend: function() {
|
||||||
// Disable the Execute button
|
// Disable the Execute button
|
||||||
$('#btn-flash').prop('disabled', true);
|
$('#btn-flash').prop('disabled', true);
|
||||||
|
$('#btn-download').prop('disabled', true);
|
||||||
self.disable_tool_buttons(true);
|
self.disable_tool_buttons(true);
|
||||||
|
|
||||||
self.trigger(
|
self.trigger(
|
||||||
|
@ -3569,6 +3577,7 @@ define('tools.querytool', [
|
||||||
self.download_csv_obj = undefined;
|
self.download_csv_obj = undefined;
|
||||||
// Enable the execute button
|
// Enable the execute button
|
||||||
$('#btn-flash').prop('disabled', false);
|
$('#btn-flash').prop('disabled', false);
|
||||||
|
$('#btn-download').prop('disabled', false);
|
||||||
self.disable_tool_buttons(false);
|
self.disable_tool_buttons(false);
|
||||||
self.trigger(
|
self.trigger(
|
||||||
'pgadmin-sqleditor:loading-icon:hide');
|
'pgadmin-sqleditor:loading-icon:hide');
|
||||||
|
|
Loading…
Reference in New Issue