From 5103d59ddc92d0fb994cea7365c3fef8a5d743af Mon Sep 17 00:00:00 2001 From: iainp5 Date: Tue, 8 Oct 2024 07:14:33 +0100 Subject: Fix for mobiles --- play.js | 49 +++++++++++++++++++++++-------------------------- 1 file changed, 23 insertions(+), 26 deletions(-) (limited to 'play.js') diff --git a/play.js b/play.js index c1e4111..4fea383 100644 --- a/play.js +++ b/play.js @@ -260,33 +260,30 @@ function on_click_space(evt) { } function on_click_card(evt) { - //console.log('on_click_card') - if (evt.button === 0) { - const card = evt.target.my_card; - console.log('on_click_card_called with card:', card); - if (is_action('card', card)) { - console.log('in action card') - if (send_action('card', card)) { - evt.stopPropagation(); - } - } - //First check for TST special power - else if (is_card_action('card_tst_8', card)) { - show_popup_menu(evt, "popup_tst_8", card, cards[card].name) - } - - //Check for Common European Home - else if (is_card_action('card_ceh', card)) { - show_popup_menu(evt, "popup_ceh_check", card, cards[card].name) - } else if (is_card_action('card_opp_event', card)) { - console.log('in action card_opp_event') - show_popup_menu(evt, "popup_opp_event", card, cards[card].name) + const card = evt.target.my_card; + console.log('on_click_card_called with card:', card); + if (is_action('card', card)) { + console.log('in action card') + if (send_action('card', card)) { + evt.stopPropagation(); } - else { - console.log('in action card_my_event') - show_popup_menu(evt, "popup", card, cards[card].name) - } - } + } + //First check for TST special power + else if (is_card_action('card_tst_8', card)) { + show_popup_menu(evt, "popup_tst_8", card, cards[card].name) + } + + //Check for Common European Home + else if (is_card_action('card_ceh', card)) { + show_popup_menu(evt, "popup_ceh_check", card, cards[card].name) + } else if (is_card_action('card_opp_event', card)) { + console.log('in action card_opp_event') + show_popup_menu(evt, "popup_opp_event", card, cards[card].name) + } + else { + console.log('in action card_my_event') + show_popup_menu(evt, "popup", card, cards[card].name) + } } function is_action(action) { -- cgit v1.2.3