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