Skip to content

Commit c091f59

Browse files
authored
Merge pull request #480 from ImagingDataCommons/user/mt/multi-part-manifest
Disable BQ table download button when no column is selected.
2 parents 0793b02 + c4caf86 commit c091f59

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

static/js/cohorts/cohort-details.js

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,6 @@ require([
5555
], function($, jqueryui, base, tippy, bootstrap) {
5656
A11y.Core();
5757

58-
var enable_buttons = function() {
59-
$('#download-csv').removeAttr('disabled');
60-
$('#download-tsv').removeAttr('disabled');
61-
$('#download-json').removeAttr('disabled');
62-
$('#get-bq-table').removeAttr('disabled');
63-
};
64-
6558
var downloadToken = new Date().getTime();
6659

6760
$('#download-csv').on('click', function(e) {
@@ -131,7 +124,7 @@ require([
131124

132125
if(manifest_type == 'file-manifest') {
133126
base.blockResubmit(function () {
134-
enable_buttons();
127+
update_download_manifest_buttons();
135128
$('#manifest-in-progress').modal('hide');
136129
}, downloadToken, 'downloadToken');
137130
}
@@ -194,11 +187,11 @@ require([
194187
}
195188
},
196189
complete: function(xhr, status) {
190+
update_download_manifest_buttons();
197191
$('#manifest-in-progress').modal('hide');
198-
enable_buttons();
199192
$('#export-manifest-modal').modal('hide');
200-
$('input[name="manifest-type"][value="file-manifest"]').triggerHandler('click');
201193
$('#export-manifest-form')[0].reset();
194+
$('#bq-export-option input').prop('checked', true).trigger("click");
202195
}
203196
});
204197
}
@@ -220,12 +213,14 @@ require([
220213
$('#download-csv').attr('disabled', 'disabled');
221214
$('#download-tsv').attr('disabled', 'disabled');
222215
$('#download-json').attr('disabled', 'disabled');
216+
$('#get-bq-table').attr('disabled', 'disabled');
223217
}
224218
else
225219
{
226220
$('#download-csv').removeAttr('disabled');
227221
$('#download-tsv').removeAttr('disabled');
228222
$('#download-json').removeAttr('disabled');
223+
$('#get-bq-table').removeAttr('disabled');
229224
}
230225

231226
if (num_selected_column == 0) {

0 commit comments

Comments
 (0)