diff --git a/assets/main.js b/assets/main.js index 19d98f8..85fcc42 100644 --- a/assets/main.js +++ b/assets/main.js @@ -20,17 +20,19 @@ class Button extends HTMLButtonElement { } class SourceShower extends Button { + connectedCallback() { + this.innerText = "?" + } click() { this.closest("div.line").querySelector("p[is=source-text]").toggle() - if (this.innerText == "show source") { - this.innerText = "hide source"; + if (this.innerHTML.includes("strong")) { + this.innerHTML = "?"; } else { - this.innerText = "show source"; + this.innerHTML = "?"; } } } - class LineRemover extends Button { click() { const container = this.closest("div.line"); diff --git a/templates/index.tmpl b/templates/index.tmpl index 9f7ab80..38b78bc 100644 --- a/templates/index.tmpl +++ b/templates/index.tmpl @@ -3,7 +3,7 @@