From f361c42df67f66e1f3817a232a2309c3c54853de Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Mon, 27 May 2024 22:11:34 +0200 Subject: no piece tooltip on cards! --- play.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'play.js') diff --git a/play.js b/play.js index 2b52dee..c664c89 100644 --- a/play.js +++ b/play.js @@ -324,6 +324,13 @@ function is_action(action, arg) { return !!(view.actions && view.actions[action] && set_has(view.actions[action], arg)) } +function create_element(action, id, style) { + let e = document.createElement("div") + e.className = style + register_action(e, action, id) + return e +} + function create_piece(action, id, style) { let e = document.createElement("div") e.className = style @@ -343,12 +350,12 @@ function make_tc_deck(n) { for (let suit = 0; suit <= 3; ++suit) { for (let value = 2; value <= 13; ++value) { let c = (n << 7) | (suit << 4) | value - ui.tc[c] = create_piece("card", c, "card tc deck_" + (n+1) + " " + suit_class[suit] + value) + ui.tc[c] = create_element("card", c, "card tc deck_" + (n+1) + " " + suit_class[suit] + value) } } for (let value = 2; value <= 3; ++value) { let c = (n << 7) | (4 << 4) | value - ui.tc[c] = create_piece("card", c, "card tc deck_" + (n+1) + " R") + ui.tc[c] = create_element("card", c, "card tc deck_" + (n+1) + " R") } } -- cgit v1.2.3