Skip to content

Commit 543e5a2

Browse files
committed
sidebar hide on css
1 parent bf33390 commit 543e5a2

File tree

3 files changed

+34
-15
lines changed

3 files changed

+34
-15
lines changed

doc/themes/scikit-learn/layout.html

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
Layout for scikit-learn, after a design made by Angel Soler
66
(http://angelsoler.net)
77

8-
Update: Collapsable sidebar added - 13/03/2012 - Jaques Grobler
98
Update: Next-page button added - 16/03/2012 - Jaques Grobler
109

1110

@@ -25,9 +24,6 @@
2524

2625
{% block extrahead %}
2726
{% if pagename != 'index' %}
28-
{% if theme_collapsiblesidebar|tobool %}
29-
<script type="text/javascript" src="{{ pathto('_static/sidebar.js', 1) }}"></script>
30-
{% endif %}
3127
{% endif %}
3228
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
3329
<script src="{{ pathto('_static/js/bootstrap.min.js', 1)}}" type="text/javascript"></script>
@@ -43,8 +39,6 @@
4339
}
4440
);
4541
var bodywrapper = $('.bodywrapper');
46-
var sidebarbutton = $('#sidebarbutton');
47-
sidebarbutton.css({'height': '900px'});
4842
</script>
4943
{% endblock %}
5044

@@ -276,6 +270,10 @@ <h2>Machine Learning in Python</h2>
276270
{{ toc }}
277271
</div>
278272
</div>
273+
{% if theme_collapsiblesidebar|tobool %}
274+
<input type="checkbox" id="nav-trigger" class="nav-trigger" checked />
275+
<label for="nav-trigger"></label>
276+
{% endif %}
279277
{% endif %}
280278

281279

doc/themes/scikit-learn/static/nature.css_t

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,10 @@ div.content-wrapper {
142142
}
143143

144144
div.content {
145-
margin-left: 210px;
146-
padding-bottom: 10px;
145+
z-index: 1;
146+
position: relative;
147+
background-color: #FFF;
148+
padding-left: 25px;
147149
}
148150

149151
div.example_digits {
@@ -254,6 +256,7 @@ div.sphinxsidebar {
254256
border-left-width: 0;
255257
border-bottom-width: 0;
256258
margin-top: 0;
259+
position: absolute;
257260
}
258261

259262
div.sphinxsidebar h3 {
@@ -277,9 +280,31 @@ div.sphinxsidebarwrapper {
277280

278281
{% if theme_collapsiblesidebar|tobool %}
279282
/* for collapsible sidebar */
280-
div#sidebarbutton {
281-
background-color: #F6F6F6;
282-
position: relative;
283+
.nav-trigger {
284+
position: fixed;
285+
clip: rect(0, 0, 0, 0);
286+
}
287+
288+
label[for="nav-trigger"] {
289+
position: fixed;
290+
margin-top: 55px;
291+
margin-left: 0px;
292+
z-index: 2;
293+
width: 30px;
294+
height: 30px;
295+
cursor: pointer;
296+
background-image: url(http://github.com/"data:image/svg+xml;utf8,<svg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20version='1.1'%20x='0px'%20y='0px'%20width='30px'%20height='30px'%20viewBox='0%200%2030%2030'%20enable-background='new%200%200%2030%2030'%20xml:space='preserve'><rect%20width='30'%20height='6'/><rect%20y='24'%20width='30'%20height='6'/><rect%20y='12'%20width='30'%20height='6'/></svg>");
297+
background-size: contain;
298+
}
299+
.nav-trigger:checked + label {
300+
margin-left: 190px;
301+
}
302+
303+
.nav-trigger:checked ~ div.content {
304+
margin-left: 190px;
305+
}
306+
.nav-trigger + label, div.content {
307+
transition: left 0.4s;
283308
}
284309
{% endif %}
285310

doc/tune_toc.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
(!$(this).children('ul').is(':hidden')) ? '\u25ba' : '\u25bc');
1212
$(this).children('ul').toggle();
1313
}
14-
// Update the sidebar height when expanding/collapsing toctree elemements
15-
$('#sidebarbutton').animate({height : $('.toctree-wrapper').height() + 50}, 0);
1614
return true; //Makes links clickable
1715
}
1816
})
@@ -22,8 +20,6 @@
2220
$('li.toctree-l2:not(:has(ul))').attr('data-content', '-');
2321
$('li.toctree-l2:has(ul)').attr('data-content', '\u25ba');
2422
$('li.toctree-l2:has(ul)').css('cursor', 'pointer');
25-
//Initialise the sidebar button with the collapsing toctree
26-
$('#sidebarbutton').animate({height : $('.toctree-wrapper').height() + 50}, 0);
2723
2824
$('.toctree-l2').hover(
2925
function () {

0 commit comments

Comments
 (0)