Merge pull request #8530 from SvenDowideit/auto-scroll-to-auto-index-section-the-user-requested
Turn off editing for auto-generated index pages, and scroll the user to the right section
This commit is contained in:
commit
c2096d7096
2 changed files with 16 additions and 0 deletions
3
docs/theme/mkdocs/autoindex.html
vendored
3
docs/theme/mkdocs/autoindex.html
vendored
|
@ -1,3 +1,6 @@
|
||||||
|
no_edit: true
|
||||||
|
auto_scroll_to_path: true
|
||||||
|
|
||||||
# Table of Contents
|
# Table of Contents
|
||||||
|
|
||||||
{% for nav_item in nav %}
|
{% for nav_item in nav %}
|
||||||
|
|
13
docs/theme/mkdocs/base.html
vendored
13
docs/theme/mkdocs/base.html
vendored
|
@ -69,8 +69,10 @@
|
||||||
Latest (Version {{ major_minor }})
|
Latest (Version {{ major_minor }})
|
||||||
</a>
|
</a>
|
||||||
<ul id="documentation-version-list" class="dropdown-menu pull-right">
|
<ul id="documentation-version-list" class="dropdown-menu pull-right">
|
||||||
|
{% if not meta.no_edit %}
|
||||||
<li role="presentation" class="divider"></li>
|
<li role="presentation" class="divider"></li>
|
||||||
<li> <a class="home-link3 tertiary-nav" href="https://github.com/docker/docker/blob/master/docs/sources/{{ current_page.input_path }}" >Edit on GitHub</a></li>
|
<li> <a class="home-link3 tertiary-nav" href="https://github.com/docker/docker/blob/master/docs/sources/{{ current_page.input_path }}" >Edit on GitHub</a></li>
|
||||||
|
{% endif %}
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -127,6 +129,17 @@ piCId = '1482';
|
||||||
$(e).removeClass()
|
$(e).removeClass()
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
{% if meta.auto_scroll_to_path %}
|
||||||
|
// scroll to the right location in the generated index page
|
||||||
|
m=location.pathname.match(/^\/(.*?)\//)
|
||||||
|
if (m && m[1]) {
|
||||||
|
anchor = m[1].toLowerCase().replace(/ /, "-").replace(/\//, "-")
|
||||||
|
anchor_point = $('#'+anchor)
|
||||||
|
if (anchor_point && anchor_point[0]) {
|
||||||
|
$(window).scrollTop(anchor_point.offset().top);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{% endif %}
|
||||||
})
|
})
|
||||||
var userName = getCookie('docker_sso_username');
|
var userName = getCookie('docker_sso_username');
|
||||||
if (userName) {
|
if (userName) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue