Skip to content

Commit

Permalink
Fixes readthedocs theme problems with collapsed tables
Browse files Browse the repository at this point in the history
  • Loading branch information
danwos committed Apr 3, 2020
1 parent 2cb0826 commit 7ae5332
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
4 changes: 4 additions & 0 deletions sphinxcontrib/needs/css/common.css
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ div.dt-buttons button {
clear: both;
}

.toggle .header p{
display: inline;
}

.toggle .header:after {
content: " ▷";
}
Expand Down
15 changes: 9 additions & 6 deletions sphinxcontrib/needs/libs/html/sphinx_needs_collapse.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
$(document).ready(function() {
$(".toggle > *").hide();
$(".toggle .header").show();
$(".toggle .header").click(function() {
$(this).parent().children().not(".header").toggle(200);
$(this).parent().children(".header").toggleClass("open");
})
window.setTimeout(function() {
$(".toggle > *").hide();
$(".toggle .header").show();
$(".toggle .header").click(function() {
$(this).parent().children().not(".header").not(".wy-table-responsive").toggle(200);
$(this).parent().children('.wy-table-responsive').children().toggle(200);
$(this).parent().children(".header").toggleClass("open");
})
}, 10);
});
//
// // readthedocs fix
Expand Down

0 comments on commit 7ae5332

Please sign in to comment.