mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-24 23:38:56 +00:00
fix: enhance diagram copy button functionality and ensure Echarts visibility on home page
This commit is contained in:
+4
-1
@@ -527,7 +527,10 @@ class FixIt {
|
||||
this.util.forEach(document.querySelectorAll('.diagram-copy-btn'), ($btn) => {
|
||||
$btn.addEventListener('click', () => {
|
||||
stagingDOM.stage($btn.parentElement.querySelector('template').content.cloneNode(true))
|
||||
const code = stagingDOM.contentAsText();
|
||||
let code = stagingDOM.contentAsText();
|
||||
try {
|
||||
code = JSON.stringify(JSON.parse(code), null, 2);
|
||||
} catch {}
|
||||
this.util.copyText(code).then(() => {
|
||||
$btn.toggleAttribute('data-copied', true);
|
||||
setTimeout(() => {
|
||||
|
||||
@@ -6,3 +6,6 @@
|
||||
| partial "plugin/echarts.html"
|
||||
-}}
|
||||
{{- .Page.Store.Set "hasEcharts" true -}}
|
||||
{{- if eq hugo.Context.MarkupScope "home" -}}
|
||||
{{- site.Home.Store.Set "hasEcharts" true -}}
|
||||
{{- end -}}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{- hugo.Store.Set "version" "v0.4.0-alpha.2-20251012060036-b4cb5a5a" -}}
|
||||
{{- hugo.Store.Set "version" "v0.4.0-alpha.2-20251014072524-fa94e698" -}}
|
||||
{{- .Store.Set "this" dict -}}
|
||||
|
||||
{{- partial "init/detection-env.html" . -}}
|
||||
|
||||
Reference in New Issue
Block a user