Move to pre-rendered left-navs instead of post-load JS for TOC sync

This commit is contained in:
John Mulhausen 2017-01-31 17:06:51 -08:00 committed by Misty Stanley-Jones
parent 92f1c95808
commit c24fec68b6
2 changed files with 3 additions and 5 deletions

View File

@ -1,6 +1,7 @@
{% for item in tree %}{% if item.heading %}{% else %}{% if item.sectiontitle %}<li class="leaf menu-closed"><a href="javascript:void(0)" class="expand-menu "><span class="menu-icon" aria-hidden="true"></span>{{ item.sectiontitle }}</a>
{% for item in tree %}{% if item.sectiontitle %}{% capture treeString %}{{ item.section | downcase }}{% endcapture %}{% capture pageURLString %}"{{ page.url }}"{% endcapture %}
<li class="leaf {% if treeString contains pageURLString %}menu-open{% else %}menu-closed{% endif %}"><a href="javascript:void(0)" class="expand-menu "><span class="menu-icon" aria-hidden="true"></span>{{ item.sectiontitle }}</a>
<ul class="nav-sub">
{% assign tree = item.section %}{% include tree.html %}
</ul>
{% else %}
<li class="leaf"><a href="{{ item.path }}" class="{% if item.path == page.url and item.nosync != true %}active currentPage{% endif %}">{{ item.title }}</a></li>{% endif %}{% endif %}{% endfor %}
<li class="leaf"><a href="{{ item.path }}" class="{% if item.path == page.url and item.nosync != true %}active currentPage{% endif %}">{{ item.title }}</a></li>{% endif %}{% endfor %}

View File

@ -56,9 +56,6 @@ function hookupTOCEvents()
}
return false;
});
$(".currentPage").each(function(){
$(this).parentsUntil($('.docsidebarnav_section')).addClass("active").removeClass("menu-closed").addClass("menu-open");
});
$(".left-off-canvas-menu").css("display","block");
// console.log(metadata);
$("#st-search-input").on('keyup change', function(e) {