Skip to content

Commit

Permalink
Merge 45d4f98 into 4f88207
Browse files Browse the repository at this point in the history
  • Loading branch information
yannickkuypers committed Aug 13, 2020
2 parents 4f88207 + 45d4f98 commit e2f37e9
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
12 changes: 12 additions & 0 deletions atramhasis/static/js/concept.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
$(document).ready(function () {
var searchUrl = window.location.search.substr(1);
var params = searchUrl.split();

if (params.indexOf('view_tree') > -1) {
openTreeTab();
}
});

function openTreeTab() {
document.getElementById('tree-link').click();
}
3 changes: 2 additions & 1 deletion atramhasis/templates/concept.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
</div>
<ul class="tabs tabnav" data-tab role="tablist" style="width:100%">
<li class="tab-title active" role="presentation" style="width:50%;"><a href="#panel2-1" role="tab" tabindex="0" aria-selected="true" aria-controls="panel2-1">{% trans %}view_relations{% endtrans %}</a></li>
<li class="tab-title" role="presentation" style="width:50%;"><a href="#panel2-2" role="tab" tabindex="0" aria-selected="false" aria-controls="panel2-2" style="border-left: 0;">{% trans %}view_tree{% endtrans %}</a></li>
<li class="tab-title" role="presentation" style="width:50%;"><a id="tree-link" href="#panel2-2" role="tab" tabindex="0" aria-selected="false" aria-controls="panel2-2" style="border-left: 0;">{% trans %}view_tree{% endtrans %}</a></li>
</ul>
<div class="tabs-content">
<section role="tabpanel" aria-hidden="false" class="content active" id="panel2-1">
Expand Down Expand Up @@ -180,4 +180,5 @@
{% endif %}
</div>
</div>
<script type="text/javascript" src="{{ request.static_path(app_package + ':static/js/concept.js') }}"></script>
{% endblock %}
2 changes: 1 addition & 1 deletion atramhasis/templates/tree.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@
d3.event.preventDefault();
if (d.concept_id) {
var basepath = '{{ request.route_path('concept', scheme_id= scheme_id, c_id = '') }}';
window.location.href = basepath + d.concept_id;
window.location.href = basepath + d.concept_id +'?view_tree';
}
else {
if (d.scheme_id) {
Expand Down

0 comments on commit e2f37e9

Please sign in to comment.