summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMischa Untaga <99098079+MischaU8@users.noreply.github.com>2023-12-04 14:52:40 +0100
committerMischa Untaga <99098079+MischaU8@users.noreply.github.com>2023-12-04 14:52:40 +0100
commit9bbf75f54c152aed9d40954b8a61481c60033de6 (patch)
tree025d2b03d93038ceabada56933769927a632279b
parent99705462cadde368f8067b94be459b1cec0d5ca9 (diff)
downloadvotes-for-women-9bbf75f54c152aed9d40954b8a61481c60033de6.tar.gz
use mousedown events
-rw-r--r--play.js9
1 files changed, 4 insertions, 5 deletions
diff --git a/play.js b/play.js
index 9d25f31..41149c2 100644
--- a/play.js
+++ b/play.js
@@ -358,8 +358,7 @@ function create_campaigner(color, i) {
className: `piece ${color}`,
my_campaigner: i,
})
- // TODO use onmousedown and figure out why it didn't work on mobile
- e.addEventListener("click", on_click_campaigner)
+ e.addEventListener("mousedown", on_click_campaigner)
return e
}
@@ -374,14 +373,13 @@ function build_user_interface() {
REGIONS_LAYOUT.push(LAYOUT[r.replaceAll(' & ', '')])
}
- // TODO use onmousedown and figure out why it didn't work on mobile
- ui.congress_box.addEventListener("click", on_click_congress)
+ ui.congress_box.addEventListener("mousedown", on_click_congress)
for (let c = 1; c <= 6; ++c) {
elt = ui.congress[c] = create("div", {
className: "piece congress",
style: `left:${15 + (c-1) * 42}px;top:-6px;`,
})
- elt.addEventListener("click", on_click_congress)
+ elt.addEventListener("mousedown", on_click_congress)
}
for (let i = 0; i < 12; ++i) {
@@ -401,6 +399,7 @@ function build_user_interface() {
className: `card card_${c}`,
my_card: c,
})
+ // TODO use onmousedown and figure out why it didn't work on mobile
elt.addEventListener("click", on_click_card)
}