diff --git a/js/tree-edam-stand-alone.js b/js/tree-edam-stand-alone.js index b349663c..965c3b17 100644 --- a/js/tree-edam-stand-alone.js +++ b/js/tree-edam-stand-alone.js @@ -203,12 +203,21 @@ function interactive_edam_browser(){ setUrlParameters(""); } $("#details-"+identifier).remove(); + var details = build_detail_panel(d, uri, branch_of_term, identifier, true); + fill_detail_panel(d, uri, branch_of_term, identifier, details); + fill_community_panel(d, uri, branch_of_term, identifier, details); + append_detail_panel_to_edam_accordion(d, uri, branch_of_term, identifier, details); + } + + function build_detail_panel (d, uri, branch_of_term, identifier, collapsed){ details = ""; details += '
'; details += '
'; details += '
'; details += '

'; - details += 'Details of term "" '; + details += (collapsed?'Details of term "':''); + details += ''; + details += (collapsed?'" ':''); // details += ''+branch_of_term+''; details += ''; details += ''; @@ -216,13 +225,17 @@ function interactive_edam_browser(){ details += ''; details += '

'; details += '
'; - details += '
'; + details += '
':''); details += '
'; details += '
'; details += '
'; details += '
'; details=$(details); details.find(".term-name-heading").text(d.data.text); + return details; + } + + function fill_detail_panel (d, uri, branch_of_term, identifier, details){ var table = details.find("tbody.details"); table.children().remove(); var table_parent = details.find("table").parent(); @@ -286,6 +299,9 @@ function interactive_edam_browser(){ } } }); + } + + function fill_community_panel (d, uri, branch_of_term, identifier, details){ var community = details.find("tbody.community"); var caller_b=biotool_api().get_for(current_branch, d.data.text, uri, d); if (caller_b.is_enabled()){ @@ -375,6 +391,9 @@ function interactive_edam_browser(){ community.parent().remove(); } details.find('[data-toggle="tooltip"]').tooltip(); + } + + function append_detail_panel_to_edam_accordion (d, uri, branch_of_term, identifier, details){ $("#edamAccordion").find(".panel-group").first().find(".collapse").collapse("hide"); var length=$("#edamAccordion").find(".panel-group").length; if(length>0){