summaryrefslogtreecommitdiffstats
path: root/lethality-selector.mjs
diff options
context:
space:
mode:
Diffstat (limited to 'lethality-selector.mjs')
-rw-r--r--lethality-selector.mjs35
1 files changed, 0 insertions, 35 deletions
diff --git a/lethality-selector.mjs b/lethality-selector.mjs
deleted file mode 100644
index 80c3e71..0000000
--- a/lethality-selector.mjs
+++ /dev/null
@@ -1,35 +0,0 @@
-class LethalitySelector {
- constructor(elt) {
- this.elt = elt
-
- for (const elt of this.elt.querySelectorAll('button')) {
- elt.addEventListener('click', this.select.bind(this))
- }
- }
-
- attach() {
- this.elt.classList.remove('hidden')
- }
-
- detach() {
- this.elt.classList.add('hidden')
- }
-
- get onItemSelected() {
- if (this._onItemSelected !== undefined) {
- return this._onItemSelected
- }
- return () => {}
- }
-
- set onItemSelected(fn) {
- this._onItemSelected = fn
- }
-
- select(evt) {
- window.evt = evt
- this.onItemSelected(evt.target.id == 'lethal')
- }
-}
-
-export default LethalitySelector