Skip to content

Commit ed40d39

Browse files
committed
Move fiddeling with layout (hide empty sub menu) to template.
1 parent 11d05dd commit ed40d39

File tree

3 files changed

+18
-6
lines changed

3 files changed

+18
-6
lines changed

docs/_static/searchtools.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -544,9 +544,6 @@ var Search = {
544544

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

docs/_templates/page.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@
77
{% block footer %}
88
<script type="text/javascript">
99
$(document).ready(function() {
10+
// Hide empty sub menu.
1011
if ($.trim($(".topbar-contents .bd-toc").html()) === "") {
1112
$(".topbar-contents .bd-toc").css("visibility", "hidden");
1213
}
14+
// Add toggle to exercise solutions (admonition with class 'toggle')
1315
$(".toggle > *").hide();
1416
$(".toggle .admonition-title").show();
1517
$(".toggle .admonition-title").click(function() {

docs/_templates/search.html

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ <h1 id="search-documentation">{{ _('Search') }}</h1>
5151
<option value="all">All Documentation</option>
5252
{% for id, title in
5353
[
54-
["backend","Backend"],
55-
["classic-ui","Classic UI"],
56-
["contributing","Contributing"],
54+
["backend","Backend"],
55+
["classic-ui","Classic UI"],
56+
["contributing","Contributing"],
5757
] %}
5858
<option value="{{id}}">{{ title }}</option>
5959
{% endfor %}
@@ -76,3 +76,16 @@ <h1 id="search-documentation">{{ _('Search') }}</h1>
7676
</div>
7777
{% endblock %}
7878
{% endblock %}
79+
80+
81+
{% block footer %}
82+
<script type="text/javascript">
83+
$(document).ready(function() {
84+
// Hide empty sub menu.
85+
if ($.trim($(".topbar-contents .bd-toc").html()) === "") {
86+
$(".topbar-contents .bd-toc").css("visibility", "hidden");
87+
}
88+
});
89+
</script>
90+
91+
{% endblock %}

0 commit comments

Comments
 (0)