add close button when sidebar showed in mobile screen
This commit is contained in:
parent
051840df3c
commit
00ca185f8d
|
@ -1045,7 +1045,8 @@ h2.footnotes{
|
|||
|
||||
/******** responsive for sidebar *******/
|
||||
|
||||
#toggle-sidebar {
|
||||
#toggle-sidebar,
|
||||
#table-of-contents .close-sidebar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
@ -1078,6 +1079,10 @@ h2.footnotes{
|
|||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#table-of-contents .close-sidebar {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
/******** End responsive for sidebar *******/
|
||||
|
|
|
@ -49,6 +49,11 @@ $( document ).ready(function() {
|
|||
var toggleSidebar = $('<div id="toggle-sidebar"><a href="#table-of-contents"><h2>Table of Contents</h2></a></div>');
|
||||
$('#content').prepend(toggleSidebar);
|
||||
|
||||
// add close button when sidebar showed in mobile screen
|
||||
var closeBtn = $('<a class="close-sidebar" href="#">Close</a>');
|
||||
var tocTitle = $('#table-of-contents').find('h2');
|
||||
tocTitle.append(closeBtn);
|
||||
|
||||
});
|
||||
|
||||
window.SphinxRtdTheme = (function (jquery) {
|
||||
|
|
Loading…
Reference in New Issue