mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 22:37: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;
|
top: 0.9em;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
aside#toc.coarse li ol {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,8 @@
|
|||||||
window.onload = function() {
|
window.onload = function() {
|
||||||
var container = document.querySelector('#toc');
|
var container = document.querySelector('#toc');
|
||||||
|
|
||||||
var selector = "h2";
|
|
||||||
if (container.className.split(" ").indexOf("coarse") == -1) {
|
|
||||||
selector += ",h3";
|
|
||||||
}
|
|
||||||
|
|
||||||
var toc = initTOC({
|
var toc = initTOC({
|
||||||
selector: selector,
|
selector: 'h2, h3',
|
||||||
scope: '.post',
|
scope: '.post',
|
||||||
overwrite: false,
|
overwrite: false,
|
||||||
prefix: 'toc'
|
prefix: 'toc'
|
||||||
|
|||||||
Reference in New Issue
Block a user