mirror of
https://github.com/danpros/htmly.git
synced 2026-04-18 03:26:20 +05:30
Update functions.php
This commit is contained in:
parent
06140ec58c
commit
c33d3676d0
1 changed files with 7 additions and 1 deletions
|
|
@ -523,7 +523,13 @@ function get_posts($posts, $page = 1, $perpage = 0)
|
|||
$load = <<<EOF
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
generateTOC('.post-{$post->date}');
|
||||
if (document.getElementById('toc-wrapper.post-{$post->date}').parentNode.classList.contains('post-{$post->date}')) {
|
||||
generateTOC('.post-{$post->date}');
|
||||
} else {
|
||||
document.getElementById('toc-wrapper.post-{$post->date}').parentNode.classList.add('post-{$post->date}');
|
||||
generateTOC('.post-{$post->date}');
|
||||
}
|
||||
|
||||
});
|
||||
</script>
|
||||
EOF;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue