fix a bug in toc selector
This commit is contained in:
parent
cf18ae777f
commit
3cd15e9a35
1 changed files with 14 additions and 11 deletions
|
@ -17,7 +17,9 @@
|
||||||
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
document.querySelector(".toc").addEventListener("click", function () {
|
var toc = document.querySelector(".toc");
|
||||||
|
if (toc) {
|
||||||
|
toc.addEventListener("click", function () {
|
||||||
if (event.target.tagName !== "A") {
|
if (event.target.tagName !== "A") {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
if (this.open) {
|
if (this.open) {
|
||||||
|
@ -29,4 +31,5 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue