tweak source showing
This commit is contained in:
parent
b482fb2a44
commit
240efcfac1
@ -20,17 +20,19 @@ class Button extends HTMLButtonElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class SourceShower extends Button {
|
class SourceShower extends Button {
|
||||||
|
connectedCallback() {
|
||||||
|
this.innerText = "?"
|
||||||
|
}
|
||||||
click() {
|
click() {
|
||||||
this.closest("div.line").querySelector("p[is=source-text]").toggle()
|
this.closest("div.line").querySelector("p[is=source-text]").toggle()
|
||||||
if (this.innerText == "show source") {
|
if (this.innerHTML.includes("strong")) {
|
||||||
this.innerText = "hide source";
|
this.innerHTML = "?";
|
||||||
} else {
|
} else {
|
||||||
this.innerText = "show source";
|
this.innerHTML = "<strong>?</strong>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class LineRemover extends Button {
|
class LineRemover extends Button {
|
||||||
click() {
|
click() {
|
||||||
const container = this.closest("div.line");
|
const container = this.closest("div.line");
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<title>Trunkless</title>
|
<title>Trunkless</title>
|
||||||
<style>
|
<style>
|
||||||
div.line:not(.unpinned) {
|
div.line:not(.unpinned) > .linetext {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@ -22,7 +22,7 @@
|
|||||||
<button is="line-upper">up</button>
|
<button is="line-upper">up</button>
|
||||||
<button is="line-downer">down</button>
|
<button is="line-downer">down</button>
|
||||||
<button is="line-remover">remove</button>
|
<button is="line-remover">remove</button>
|
||||||
<button is="source-shower">show source</button>
|
<button is="source-shower"></button>
|
||||||
</span>
|
</span>
|
||||||
<span class="linetext"></span>
|
<span class="linetext"></span>
|
||||||
<p is="source-text"></p>
|
<p is="source-text"></p>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user