From a336ca94fd473fdfd6cc5a83ce879429c0f1db92 Mon Sep 17 00:00:00 2001 From: zsloan Date: Mon, 28 Dec 2020 15:15:01 -0600 Subject: Added JS controlling which location_type options are available depending upon the selected target dataset --- wqflask/wqflask/static/new/javascript/show_trait.js | 11 ++++++++--- 1 file 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"); -- cgit v1.2.3