aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzsloan2020-12-28 15:15:01 -0600
committerzsloan2020-12-28 15:15:01 -0600
commita336ca94fd473fdfd6cc5a83ce879429c0f1db92 (patch)
tree1aa022169e5ef2e5055fd50252a73a9c9d9675fc
parentab9aebc567d1a10282ae55f282993a3fa9dd3582 (diff)
downloadgenenetwork2-a336ca94fd473fdfd6cc5a83ce879429c0f1db92.tar.gz
Added JS controlling which location_type options are available depending upon the selected target dataset
-rw-r--r--wqflask/wqflask/static/new/javascript/show_trait.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/wqflask/wqflask/static/new/javascript/show_trait.js b/wqflask/wqflask/static/new/javascript/show_trait.js
index 6918cf34..a301615b 100644
--- a/wqflask/wqflask/static/new/javascript/show_trait.js
+++ b/wqflask/wqflask/static/new/javascript/show_trait.js
@@ -519,21 +519,26 @@ $('select[name=corr_type]').change(on_corr_method_change);
on_dataset_change = function() {
let dataset_type = $('select[name=corr_dataset] option:selected').data('type');
+ let location_type = $('select[name=location_type] option:selected').val();
if (dataset_type == "mrna_assay"){
$('#min_expr_filter').show();
- $('#location_filter').show();
+ $('select[name=location_type] option:disabled').prop('disabled', false)
}
else if (dataset_type == "pheno"){
$('#min_expr_filter').show();
- $('#location_filter').hide();
+ $('select[name=location_type]>option:eq(0)').prop('disabled', true).attr('selected', false);
+ $('select[name=location_type]>option:eq(1)').prop('disabled', false).attr('selected', true);
}
else {
$('#min_expr_filter').hide();
- $('#location_filter').show();
+ $('select[name=location_type]>option:eq(0)').prop('disabled', false).attr('selected', true);
+ $('select[name=location_type]>option:eq(1)').prop('disabled', true).attr('selected', false);
}
}
+
$('select[name=corr_dataset]').change(on_dataset_change);
+$('select[name=location_type]').change(on_dataset_change);
submit_special = function(url) {
get_table_contents_for_form_submit("trait_data_form");