Skip to content

Commit

Permalink
Fix collapsed toc not showing on mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
juba committed Feb 19, 2016
1 parent 7b14000 commit 78bcf34
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 26 deletions.
4 changes: 3 additions & 1 deletion inst/templates/readthedown/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,10 @@ <h2><a href="#content">$title$</a></h2>
</div>
</div>


<div id="main">
$body$
</div>


</div>

Expand Down
13 changes: 1 addition & 12 deletions inst/templates/readthedown/readthedown.css
Original file line number Diff line number Diff line change
Expand Up @@ -310,11 +310,6 @@ dl dd{
}


@media screen and (max-width: 480px){
.mobile-hide{
display:none}
}

@media screen and (max-width: 768px){
.tablet-hide{
display:none}
Expand All @@ -324,7 +319,7 @@ dl dd{
padding: 1em;
}
#content.shift{
position:fixed;
position:relative;
min-width:100%;
left:75%;
top:0;
Expand Down Expand Up @@ -382,12 +377,6 @@ dl dd{
}


@media screen and (max-width: 480px){
#content .sidebar{
width:100%}
}


#nav-top {
margin-top: 0em;
margin-bottom: 2em;
Expand Down
5 changes: 5 additions & 0 deletions inst/templates/readthedown/readthedown.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ $( document ).ready(function() {
$(document).on('click', "#table-of-contents ul li a", function() {
$("[data-toggle='wy-nav-shift']").removeClass("shift");
});
// Close menu when you click on main content
$(document).on('click', "#main, #header", function() {
$("[data-toggle='wy-nav-shift']").removeClass("shift");
});

// Make tables responsive
$(".section table").wrap("<div class='table-wrapper'></div>");
/* Pilltabs */
Expand Down
28 changes: 15 additions & 13 deletions resources/examples/readthedown/readthedown.html

Large diffs are not rendered by default.

0 comments on commit 78bcf34

Please sign in to comment.