Skip to content

Commit e288f25

Browse files
author
y-p
committed
Revert "DOC: Spihnx theme, don't sticky nav on api ref page, toc too long to fit on screen"
This reverts commit 3e618c8.
1 parent 3e618c8 commit e288f25

File tree

1 file changed

+19
-28
lines changed

1 file changed

+19
-28
lines changed

doc/source/themes/nature_with_gtoc/layout.html

+19-28
Original file line numberDiff line numberDiff line change
@@ -68,35 +68,26 @@ <h3 style="margin-top: 1.5em;">{{ _('Search') }}</h3>
6868
</div>
6969

7070
<script type="text/javascript">
71-
$(function () {
72-
73-
var chapter = window.location.href.split("/").pop()
74-
if (chapter.indexOf("api.html") === 0) {
75-
// don't sticky the nav when in the API doc,
76-
// TOC too long to fit on screem
77-
return
71+
// http://movethewebforward.org/
72+
// paul irish et al. we <3 you.
73+
var $body = $( document.body );
74+
75+
var $scrollable = $(window); // default scrollable thingy, which'll be body or docEl (html)
76+
$originalnavtop =52; //$scrollable.css('top');
77+
78+
// work on scroll, but debounced
79+
var $document = $(document).scroll( function() {
80+
var $nav = $("div.sphinxsidebar");
81+
if($scrollable.scrollTop() > ($originalnavtop - 20)) {
82+
$nav.addClass('sticky').css('top', '0');
83+
$nav.addClass('sticky').css('position', 'fixed');
84+
} else {
85+
$nav.removeClass('sticky');
86+
$nav.addClass('sticky').css('position', '');
87+
$nav.addClass('sticky').css('top', '');
7888
}
79-
// http://movethewebforward.org/
80-
// paul irish et al. we <3 you.
81-
var $body = $(document.body);
82-
83-
var $scrollable = $(window); // default scrollable thingy, which'll be body or docEl (html)
84-
$originalnavtop = 52; //$scrollable.css('top');
85-
86-
// work on scroll, but debounced
87-
var $document = $(document).scroll(function () {
88-
var $nav = $("div.sphinxsidebar");
89-
if ($scrollable.scrollTop() > ($originalnavtop - 20)) {
90-
$nav.addClass('sticky').css('top', '0');
91-
$nav.addClass('sticky').css('position', 'fixed');
92-
} else {
93-
$nav.removeClass('sticky');
94-
$nav.addClass('sticky').css('position', '');
95-
$nav.addClass('sticky').css('top', '');
96-
}
97-
98-
});
99-
})
89+
90+
});
10091
</script>
10192

10293
{%- endblock %}

0 commit comments

Comments
 (0)