@@ -65,6 +65,13 @@ require([
6565 maxWidth: 400
6666 });
6767
68+ var enable_buttons = function() {
69+ $('#download-csv').removeAttr('disabled');
70+ $('#download-tsv').removeAttr('disabled');
71+ $('#download-json').removeAttr('disabled');
72+ $('#get-bq-table').removeAttr('disabled');
73+ };
74+
6875 var downloadToken = new Date().getTime();
6976
7077 $('#download-csv').on('click', function(e) {
@@ -134,10 +141,7 @@ require([
134141
135142 if(manifest_type == 'file-manifest') {
136143 base.blockResubmit(function () {
137- $('#download-csv').removeAttr('disabled');
138- $('#download-tsv').removeAttr('disabled');
139- $('#download-json').removeAttr('disabled');
140- $('#get-bq-table').removeAttr('disabled');
144+ enable_buttons();
141145 $('#manifest-in-progress').modal('hide');
142146 }, downloadToken, 'downloadToken');
143147 }
@@ -190,7 +194,6 @@ require([
190194 }
191195 },
192196 error: function (xhr) {
193- console.log(xhr);
194197 var responseJSON = $.parseJSON(xhr.responseText);
195198 // If we received a redirect, honor that
196199 if(responseJSON.redirect) {
@@ -202,8 +205,9 @@ require([
202205 },
203206 complete: function(xhr, status) {
204207 $('#manifest-in-progress').modal('hide');
205- $('#get-bq-table').removeAttr('disabled' );
208+ enable_buttons( );
206209 $('#export-manifest-modal').modal('hide');
210+ $('input[name="manifest-type"][value="file-manifest"]').triggerHandler('click');
207211 $('#export-manifest-form')[0].reset();
208212 }
209213 });
0 commit comments