diff options
author | Brian Cully <bjc@kublai.com> | 2021-02-06 13:41:35 -0500 |
---|---|---|
committer | Brian Cully <bjc@kublai.com> | 2021-02-06 13:41:35 -0500 |
commit | 256fd05e012d5825a50368878d1c7f1c8feabfd8 (patch) | |
tree | 30148dd19b677af1ef8e25af9adc05b5145e1d9d /error.mjs | |
parent | 8ebcbad47d84d01ed441af7cbd2b8568098ecbaa (diff) | |
download | molsim-main.tar.gz molsim-main.zip |
Diffstat (limited to 'error.mjs')
-rw-r--r-- | error.mjs | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -2,8 +2,8 @@ class Error { constructor(elt) { this.elt = elt - this._boundClickHandler = this.clickHandler.bind(this) - this.button.addEventListener('click', this._boundClickHandler) + this._boundClickHandler = this.clickHandler.bind(this) + this.button.addEventListener('click', this._boundClickHandler) } get errorElt() { @@ -30,21 +30,21 @@ class Error { get onClick() { if (this._onClick !== undefined) { - return this._onClick - } - return () => {} + return this._onClick + } + return () => {} } set onClick(fn) { - this._onClick = fn + this._onClick = fn } show() { - this.elt.classList.remove('hidden') + this.elt.classList.remove('hidden') } hide() { - this.elt.classList.add('hidden') + this.elt.classList.add('hidden') } clickHandler() { |