mirror of https://github.com/docker/docs.git
Move to pre-rendered left-navs instead of post-load JS for TOC sync
This commit is contained in:
parent
92f1c95808
commit
c24fec68b6
|
@ -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 %}
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue