diff options
author | zsloan | 2022-04-28 14:19:50 +0000 |
---|---|---|
committer | zsloan | 2022-05-10 19:39:27 +0000 |
commit | 8550ef45985d157405511b4daf5046768c54bb27 (patch) | |
tree | b8cd12b3ffcea349a7a3af483d554e41ff879b60 | |
parent | 26df9d498a0f9d8b35988233023181880b086ca4 (diff) | |
download | genenetwork2-8550ef45985d157405511b4daf5046768c54bb27.tar.gz |
Add JS for submitting collection export
Also refactor the way the exports and BNW submission are done
-rw-r--r-- | wqflask/wqflask/static/new/javascript/search_results.js | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/wqflask/wqflask/static/new/javascript/search_results.js b/wqflask/wqflask/static/new/javascript/search_results.js index ff2452af..fb9f478d 100644 --- a/wqflask/wqflask/static/new/javascript/search_results.js +++ b/wqflask/wqflask/static/new/javascript/search_results.js @@ -200,10 +200,14 @@ $(function() { } exportTraits = function() { - trait_data = submitTraitsToExportOrBnw("trait_table", "export_csv") + trait_data = submitTraitsToExportOrBnw("trait_table", "export_traits_csv") }; - submitTraitsToExportOrBnw = function(table_name, destination) { + exportCollection = function() { + trait_data = submitTraits("trait_table", "export_collection") + } + + fetchTraits = function(table_name){ trait_table = $('#'+table_name); table_dict = {}; @@ -235,12 +239,11 @@ $(function() { json_table_dict = JSON.stringify(table_dict); $('input[name=export_data]').val(json_table_dict); + } - if (destination == "export_csv"){ - $('#export_form').attr('action', '/export_traits_csv'); - } else{ - $('#export_form').attr('action', '/submit_bnw'); - } + submitTraits = function(table_name, destination) { + fetchTraits(table_name); + $('#export_form').attr('action', '/' + destination); $('#export_form').submit(); }; |