mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 14:27:49 +00:00
Hide sublists of coarse in CSS instead of JS
This commit is contained in:
@@ -159,4 +159,8 @@ aside#toc {
|
||||
top: 0.9em;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
aside#toc.coarse li ol {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,8 @@
|
||||
window.onload = function() {
|
||||
var container = document.querySelector('#toc');
|
||||
|
||||
var selector = "h2";
|
||||
if (container.className.split(" ").indexOf("coarse") == -1) {
|
||||
selector += ",h3";
|
||||
}
|
||||
|
||||
var toc = initTOC({
|
||||
selector: selector,
|
||||
selector: 'h2, h3',
|
||||
scope: '.post',
|
||||
overwrite: false,
|
||||
prefix: 'toc'
|
||||
|
||||
Reference in New Issue
Block a user