Skip to content

Commit 468e5c1

Browse files
committed
hide toc div when no content to show(plone#1155)
1 parent c2a4c56 commit 468e5c1

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

docs/_static/searchtools.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,9 @@ var Search = {
544544

545545
$(document).ready(function() {
546546
Search.init();
547-
547+
if ($.trim($(".topbar-contents .bd-toc").html()) === "") {
548+
$(".topbar-contents .bd-toc").css("visibility", "hidden");
549+
}
548550
$('select[name="doc_section"]').change(function() {
549551
this.form.submit();
550552
});

docs/_templates/page.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
{% block footer %}
88
<script type="text/javascript">
99
$(document).ready(function() {
10+
if ($.trim($(".topbar-contents .bd-toc").html()) === "") {
11+
$(".topbar-contents .bd-toc").css("visibility", "hidden");
12+
}
1013
$(".toggle > *").hide();
1114
$(".toggle .admonition-title").show();
1215
$(".toggle .admonition-title").click(function() {

0 commit comments

Comments
 (0)