Hide sublists of coarse in CSS instead of JS

This commit is contained in:
Philipp Oppermann
2016-07-28 19:48:11 +02:00
parent fda5851e7c
commit 226c0ccdfc
2 changed files with 5 additions and 6 deletions

View File

@@ -159,4 +159,8 @@ aside#toc {
top: 0.9em; top: 0.9em;
position: relative; position: relative;
} }
aside#toc.coarse li ol {
display: none;
}
} }

View File

@@ -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'