mirror of
https://github.com/dillonzq/LoveIt.git
synced 2024-11-14 02:46:16 +01:00
fix(toc): Use data attributes for toc
Partially fixes: #401 Signed-off-by: Khusika Dhamar Gusti <mail@khusika.com>
This commit is contained in:
parent
1281b13109
commit
9151f85ce9
6 changed files with 6 additions and 6 deletions
|
@ -116,7 +116,7 @@
|
|||
display: none;
|
||||
margin: .8rem 0;
|
||||
|
||||
&[kept=true] {
|
||||
&[data-kept=true] {
|
||||
display: block;
|
||||
}
|
||||
|
||||
|
|
2
assets/js/theme.min.js
vendored
2
assets/js/theme.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -76,7 +76,7 @@
|
|||
|
||||
{{- /* Static TOC */ -}}
|
||||
{{- if ne $toc.enable false -}}
|
||||
<div class="details toc" id="toc-static" kept="{{ if $toc.keepStatic }}true{{ end }}">
|
||||
<div class="details toc" id="toc-static" data-kept="{{ if $toc.keepStatic }}true{{ end }}">
|
||||
<div class="details-summary toc-title">
|
||||
<span>{{ T "contents" }}</span>
|
||||
<span><i class="details-icon fas fa-angle-right"></i></span>
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -397,7 +397,7 @@ class Theme {
|
|||
initToc() {
|
||||
const $tocCore = document.getElementById('TableOfContents');
|
||||
if ($tocCore === null) return;
|
||||
if (document.getElementById('toc-static').getAttribute('kept') || this.util.isTocStatic()) {
|
||||
if (document.getElementById('toc-static').getAttribute('data-kept') || this.util.isTocStatic()) {
|
||||
const $tocContentStatic = document.getElementById('toc-content-static');
|
||||
if ($tocCore.parentElement !== $tocContentStatic) {
|
||||
$tocCore.parentElement.removeChild($tocCore);
|
||||
|
|
Loading…
Reference in a new issue