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

Commit4eacff8

Browse files
committed
Fix sidebar height issue
1 parent245418d commit4eacff8

File tree

1 file changed

+2
-20
lines changed

1 file changed

+2
-20
lines changed

‎python_docs_theme/static/sidebar.js

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@ $(function() {
2525
// global elements used by the functions.
2626
// the 'sidebarbutton' element is defined as global after its
2727
// creation, in the add_sidebar_button function
28-
varjwindow=$(window);
2928
varbodywrapper=$('.bodywrapper');
30-
vardocumentwrapper=$('.documentwrapper');
3129
varsidebar=$('.sphinxsidebar');
3230
varsidebarwrapper=$('.sphinxsidebarwrapper');
3331

@@ -45,13 +43,6 @@ $(function() {
4543
vardark_color='#AAAAAA';
4644
varlight_color='#CCCCCC';
4745

48-
functionget_viewport_height(){
49-
if(window.innerHeight)
50-
returnwindow.innerHeight;
51-
else
52-
returnjwindow.height();
53-
}
54-
5546
functionsidebar_is_collapsed(){
5647
returnsidebarwrapper.is(':not(:visible)');
5748
}
@@ -69,7 +60,6 @@ $(function() {
6960
bodywrapper.css('margin-left',bw_margin_collapsed);
7061
sidebarbutton.css({
7162
'margin-left':'0',
72-
'height':documentwrapper.height(),
7363
'border-radius':'5px'
7464
});
7565
sidebarbutton.find('span').text('»');
@@ -83,13 +73,10 @@ $(function() {
8373
sidebarwrapper.show();
8474
sidebarbutton.css({
8575
'margin-left':ssb_width_expanded-12,
86-
'height':Math.max(sidebarwrapper.height(),documentwrapper.height()),
8776
'border-radius':'0 5px 5px 0'
8877
});
8978
sidebarbutton.find('span').text('«');
9079
sidebarbutton.attr('title',_('Collapse sidebar'));
91-
//sidebarwrapper.css({'padding-top':
92-
// Math.max(window.pageYOffset - sidebarwrapper.offset().top, 10)});
9380
document.cookie='sidebar=expanded';
9481
}
9582

@@ -104,14 +91,10 @@ $(function() {
10491
'<div id="sidebarbutton"><span>&laquo;</span></div>'
10592
);
10693
varsidebarbutton=$('#sidebarbutton');
107-
// find the height of the viewport to center the '<<' in the page
108-
varviewport_height=get_viewport_height();
109-
varsidebar_offset=sidebar.offset().top;
110-
varsidebar_height=Math.max(documentwrapper.height(),sidebar.height());
11194
sidebarbutton.find('span').css({
11295
'display':'block',
11396
'position':'fixed',
114-
'top':Math.min(viewport_height/2,sidebar_height/2+sidebar_offset)-10
97+
'top':'50vh'
11598
});
11699

117100
sidebarbutton.click(toggle_sidebar);
@@ -122,8 +105,7 @@ $(function() {
122105
'background-color':'#CCCCCC',
123106
'font-size':'1.2em',
124107
'cursor':'pointer',
125-
'height':sidebar_height,
126-
'padding-top':'1px',
108+
'height':'100%',
127109
'padding-left':'1px',
128110
'margin-left':ssb_width_expanded-12
129111
});

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp