fix: optimize TOC initialization with a timeout and clean up button spacing in decryptor

This commit is contained in:
Cell
2026-03-08 17:57:41 +08:00
parent fda650ad58
commit fe7105a38a
4 changed files with 11 additions and 10 deletions
+6 -5
View File
@@ -1268,10 +1268,12 @@ class FixIt {
this.initFootnotes();
this.initTooltip();
if (includeToc) {
this.fixTocScroll();
this.initToc();
this.initTocListener();
this.initTocDialog();
window.setTimeout(() => {
this.fixTocScroll();
this.initToc();
this.initTocListener();
this.initTocDialog();
}, 100);
}
this.initPangu();
this.initMathJax();
@@ -1499,7 +1501,6 @@ class FixIt {
this.initReward();
this.initPostChatUser();
// [todo] refactor async init toc
window.setTimeout(() => {
this.initComment();
if (!this.config.encryption?.all) {
+1 -1
View File
@@ -1,4 +1,4 @@
{{- hugo.Store.Set "version" "v0.4.4-20260306024648-423a7ddb" -}}
{{- hugo.Store.Set "version" "v0.4.4-20260308095742-fda650ad" -}}
{{- .Store.Set "this" dict -}}
{{- partial "init/detection-env.html" . -}}
@@ -16,11 +16,11 @@
<input type="password" id="{{ $id }}" class="fixit-decryptor-input" placeholder="🔑 {{ $message }}" />
</label>
<button class="fixit-decryptor-btn">
{{- dict "Class" "fa-solid fa-unlock" | partial "plugin/icon.html" }} {{ T "single.enterBtn" -}}
{{- dict "Class" "fa-solid fa-unlock" | partial "plugin/icon.html" }}{{ T "single.enterBtn" -}}
</button>
{{- if not .IsPartial -}}
<button class="fixit-encryptor-btn">
{{- dict "Class" "fa-solid fa-lock" | partial "plugin/icon.html" }} {{ T "single.encryptyAgain" -}}
{{- dict "Class" "fa-solid fa-lock" | partial "plugin/icon.html" }}{{ T "single.encryptyAgain" -}}
</button>
{{- end -}}
</div>
@@ -9,10 +9,10 @@
<input type="password" id="fixit-decryptor-input" class="fixit-decryptor-input d-none" placeholder="🔑 {{ $msg }}" />
</label>
<button class="fixit-decryptor-btn d-none">
{{- dict "Class" "fa-solid fa-unlock" | partial "plugin/icon.html" }} {{ T "single.enterBtn" -}}
{{- dict "Class" "fa-solid fa-unlock" | partial "plugin/icon.html" }}{{ T "single.enterBtn" -}}
</button>
<button class="fixit-encryptor-btn d-none">
{{- dict "Class" "fa-solid fa-lock" | partial "plugin/icon.html" }} {{ T "single.encryptyAgain" -}}
{{- dict "Class" "fa-solid fa-lock" | partial "plugin/icon.html" }}{{ T "single.encryptyAgain" -}}
</button>
</div>
{{- end -}}