diff options
author | zsloan | 2021-04-22 18:23:50 +0000 |
---|---|---|
committer | zsloan | 2021-04-22 18:23:50 +0000 |
commit | 315d7f13b254aa62e277805d7d9816b0c7042479 (patch) | |
tree | fdacc1954b82e7c793c9d45d6e88414dcbe52a4f /wqflask | |
parent | 68ee0a995fceaf6aefdd3c8f780e46a83b51a0e8 (diff) | |
download | genenetwork2-315d7f13b254aa62e277805d7d9816b0c7042479.tar.gz |
Added JS that sets the 'add to collection' dropdown to default to the collection the use set as their default collection
Diffstat (limited to 'wqflask')
-rw-r--r-- | wqflask/wqflask/static/new/javascript/search_results.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/wqflask/wqflask/static/new/javascript/search_results.js b/wqflask/wqflask/static/new/javascript/search_results.js index ecb1220d..48b9b7be 100644 --- a/wqflask/wqflask/static/new/javascript/search_results.js +++ b/wqflask/wqflask/static/new/javascript/search_results.js @@ -326,4 +326,15 @@ $(function() { } ); } + apply_default = function() { + let default_collection_id = $.cookie('default_collection'); + if (default_collection_id) { + let the_option = $('[name=existing_collection] option').filter(function() { + return ($(this).text().split(":")[0] == default_collection_id); + }) + the_option.prop('selected', true); + } + } + apply_default(); + });
\ No newline at end of file |