diff options
Diffstat (limited to 'docs/gen/doc.m4')
-rw-r--r-- | docs/gen/doc.m4 | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/docs/gen/doc.m4 b/docs/gen/doc.m4 index d049d0f..ec4c858 100644 --- a/docs/gen/doc.m4 +++ b/docs/gen/doc.m4 @@ -9,26 +9,19 @@ define(`docname', <meta charset="utf-8"> <style>undivert(`gen/style.css')</style> <script>undivert(`gen/paged.polyfill.js')</script> - `<script> - class HeadingNumFix extends Paged.Handler { - constructor(chunker, polisher, caller) { - super(chunker, polisher, caller); - } + `<script defer> + window.onload = function() { + document.querySelectorAll("nav li").forEach(item => { + var heading = ""; + var parent = item; + for (parent = item; parent.nodeName != "NAV"; parent = parent.parentNode) { + if (parent.nodeName != "LI") continue; + heading = parent.getAttribute("data-item-num") + "." + heading; + } - afterRendered(_) { - document.querySelectorAll("nav li").forEach(item => { - var heading = ""; - var parent = item; - for (parent = item; parent.nodeName != "NAV"; parent = parent.parentNode) { - if (parent.nodeName != "LI") continue; - heading = parent.getAttribute("data-item-num") + "." + heading; - } - - item.setAttribute("heading-num-fix", heading.substr(0, heading.length - 1)); - }); - } + item.setAttribute("heading-num-fix", heading.substr(0, heading.length - 1)); + }); } - Paged.registerHandlers(HeadingNumFix); </script>' </head> <body> |