Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitec38133

Browse files
pradyunsgJon Wayne Parrott
authored and
Jon Wayne Parrott
committed
Use documentwrapper's height of sidebar (#9)
This is sort of a more correct thing to do since the first/last element of the body may have a margin that can cause the documentwrapper to be taller than bodywrapper.While this doesn't cause any major issues for this theme as is (due to the ample use of whitespace around the sidebar), this behaviour would help with derivative themes which remove the excessive margins on the sidebar.
1 parentf87d922 commitec38133

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

‎python_docs_theme/static/sidebar.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ $(function() {
2828
varjwindow=$(window);
2929
varjdocument=$(document);
3030
varbodywrapper=$('.bodywrapper');
31+
vardocumentwrapper=$('.documentwrapper');
3132
varsidebar=$('.sphinxsidebar');
3233
varsidebarwrapper=$('.sphinxsidebarwrapper');
3334

@@ -71,7 +72,7 @@ $(function() {
7172
bodywrapper.css('margin-left',bw_margin_collapsed);
7273
sidebarbutton.css({
7374
'margin-left':'0',
74-
'height':bodywrapper.height(),
75+
'height':documentwrapper.height(),
7576
'border-radius':'5px'
7677
});
7778
sidebarbutton.find('span').text('»');
@@ -85,7 +86,7 @@ $(function() {
8586
sidebarwrapper.show();
8687
sidebarbutton.css({
8788
'margin-left':ssb_width_expanded-12,
88-
'height':Math.max(sidebarwrapper.height(),bodywrapper.height()),
89+
'height':Math.max(sidebarwrapper.height(),documentwrapper.height()),
8990
'border-radius':'0 5px 5px 0'
9091
});
9192
sidebarbutton.find('span').text('«');
@@ -109,7 +110,7 @@ $(function() {
109110
// find the height of the viewport to center the '<<' in the page
110111
varviewport_height=get_viewport_height();
111112
varsidebar_offset=sidebar.offset().top;
112-
varsidebar_height=Math.max(bodywrapper.height(),sidebar.height());
113+
varsidebar_height=Math.max(documentwrapper.height(),sidebar.height());
113114
sidebarbutton.find('span').css({
114115
'display':'block',
115116
'position':'fixed',

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp