Move tab highlighting to Liquid instead of JS

This commit is contained in:
John Mulhausen 2017-01-31 04:41:35 -08:00 committed by Misty Stanley-Jones
parent 544ecfcf27
commit 2be1e89e27
3 changed files with 7 additions and 9 deletions

View File

@ -1,11 +1,12 @@
{% for section in site.data.toc.horizontalnav %} {% for section in site.data.toc.horizontalnav %}
{% assign topicFound="false" %} {% assign topicFound="false" %}
{% assign activeCSS = "" %}
{% assign tree = site.data.toc[section.node] %} {% assign tree = site.data.toc[section.node] %}
<!-- path comparison: item.path: {{ item.path }} == page.path: {{ page.url }} --> <!-- path comparison: item.path: {{ item.path }} == page.path: {{ page.url }} -->
{% capture thisSection %}{% include tree.html %}{% endcapture %} {% capture thisSection %}{% include tree.html %}{% endcapture %}
{% if section.path == page.url or thisSection contains "active currentPage" %} {% if section.path == page.url or thisSection contains "active currentPage" %}
<span id="currentSection" style="display:none;">{{ section.node }}</span> {% capture leftnav %}{{ thisSection }}{% endcapture %}
{{ thisSection }} {% capture activeCSS %} class="active"{% endcapture %}
{% break %}
{% endif %} {% endif %}
<li id="{{ section.node }}"{{ activeCSS }}><a href="{{ section.path }}">{{ section.title }}</a></li>
{% endfor %} {% endfor %}

View File

@ -193,8 +193,8 @@ ng\:form {
<section class="title_section darkblue"> </section> <section class="title_section darkblue"> </section>
<div class="col-md-12" style="background-color: #254356"> <div class="col-md-12" style="background-color: #254356">
<!-- tabs --> <!-- tabs -->
<ul class="tabs">{% for section in site.data.toc.horizontalnav %} <ul class="tabs">
<li id="{{ section.node }}"><a href="{{ section.path }}">{{ section.title }}</a></li>{% endfor %} {% include treebuilder.html %}
</ul> </ul>
</div> </div>
<div class=""> <div class="">
@ -205,7 +205,7 @@ ng\:form {
{% if page.tree == false %} {% if page.tree == false %}
<li class="leaf"><a href="/">Back to the index</a></li> <li class="leaf"><a href="/">Back to the index</a></li>
{% else %} {% else %}
{% include treebuilder.html %} {{ leftnav }}
{% endif %} {% endif %}
</ul> </ul>
</div> </div>

View File

@ -1,6 +1,3 @@
---
layout: null
---
var metadata; var metadata;
var autoCompleteShowing = false; var autoCompleteShowing = false;
var displayingAutcompleteResults = new Array(); var displayingAutcompleteResults = new Array();