diff options
Diffstat (limited to 'nucleotide.mjs')
-rw-r--r-- | nucleotide.mjs | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/nucleotide.mjs b/nucleotide.mjs index e646efc..13ed1b6 100644 --- a/nucleotide.mjs +++ b/nucleotide.mjs @@ -7,46 +7,46 @@ class Nucleotide { } get elt() { - if (this._elt === undefined) { - this._elt = document.createElement('li') - this._elt.classList.add('nucleotide') - } - return this._elt + if (this._elt === undefined) { + this._elt = document.createElement('li') + this._elt.classList.add('nucleotide') + } + return this._elt } get valueElt() { - if (this._valueElt === undefined) { - this._valueElt = document.createElement('span') - this.elt.appendChild(this._valueElt) - } - return this._valueElt + if (this._valueElt === undefined) { + this._valueElt = document.createElement('span') + this.elt.appendChild(this._valueElt) + } + return this._valueElt } get value() { - return this.valueElt.innerText + return this.valueElt.innerText } set value(val) { - this.valueElt.innerText = val + this.valueElt.innerText = val } get onClick() { - if (this._onClick !== undefined) { - return this._onClick - } - return () => {} + if (this._onClick !== undefined) { + return this._onClick + } + return () => {} } set onClick(fn) { - this._onClick = fn + this._onClick = fn } lock() { - this.elt.removeEventListener('click', this._boundClickHandler) + this.elt.removeEventListener('click', this._boundClickHandler) } unlock() { - this.elt.addEventListener('click', this._boundClickHandler) + this.elt.addEventListener('click', this._boundClickHandler) } select() { |