diff options
author | Pjotr Prins | 2016-06-16 08:25:53 +0000 |
---|---|---|
committer | Pjotr Prins | 2016-06-16 08:25:53 +0000 |
commit | d8e1ea9c4e7ce39391d81f7bc5e3bf19c9ea6b8d (patch) | |
tree | d062ffea77c9d4e06f223808408bd672665223bb /wqflask | |
parent | e3c84aaea84d0999b1c864427856a666075cc66a (diff) | |
download | genenetwork2-d8e1ea9c4e7ce39391d81f7bc5e3bf19c9ea6b8d.tar.gz |
Menu: simplifying JSON object
Diffstat (limited to 'wqflask')
-rw-r--r-- | wqflask/wqflask/static/new/javascript/dataset_select_menu.js | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/wqflask/wqflask/static/new/javascript/dataset_select_menu.js b/wqflask/wqflask/static/new/javascript/dataset_select_menu.js index 88a91ed2..4fb9cf4b 100644 --- a/wqflask/wqflask/static/new/javascript/dataset_select_menu.js +++ b/wqflask/wqflask/static/new/javascript/dataset_select_menu.js @@ -20,19 +20,24 @@ $(function() { alert("ERROR: GN_SERVER internal REST API is not responding"); }); - var populate_species = function() { - var species = gndata.species.map(function(item) { - return item.slice(1,3); - }); - redo_dropdown($('#species'), species); - return populate_group(); + var populate_species = function() { + var species_list = Object.keys(gndata.types).map(function(species) { + var mitem = gndata.types[species][0] + // console.log("Species menu:",species,mitem) + return [species,mitem]; + }); + redo_dropdown($('#species'), species_list); + return populate_group(); }; window.populate_species = populate_species; var populate_group = function() { var species = $('#species').val(); - var groups = gndata.groups[species].map(function(item) { - return item.slice(1,3); + + // var groups = gndata.groups[species].map(function(item) { + var type_list = gndata.types.map(function(name) { + console.log("Group menu:",species,gndata.types[name]) + return species.slice(1,3); }) redo_dropdown($('#group'), groups); return populate_type(); |