diff options
Diffstat (limited to 'play.js')
-rw-r--r-- | play.js | 22 |
1 files changed, 14 insertions, 8 deletions
@@ -173,13 +173,14 @@ function show_popup_menu(evt, menu_id, target_id, title) { console.log('show_popup_menu called with evt',evt, 'menu_id',menu_id, 'target_id', target_id, 'title', title)
let show = false
+ console.log(`menu.querySelectorAll("li")`, menu.querySelectorAll("li"))
for (let item of menu.querySelectorAll("li")) {
let action = item.dataset.action
console.log('item', item, 'action', action)
if (action) {
- console.log('in if action')
+ //console.log('in if action')
if (is_card_action(action, target_id)) {
- console.log('in is_card_action')
+ console.log('in is_card_action',)
show = true
item.classList.add("action")
item.classList.remove("disabled")
@@ -222,7 +223,8 @@ function show_popup_menu(evt, menu_id, target_id, title) { function hide_popup_menu() {
document.getElementById("popup").style.display = "none"
- document.getElementById("popup_select_card").style.display = "none"
+ document.getElementById("popup_ceh_check").style.display = "none"
+ document.getElementById("popup_opp_event").style.display = "none"
}
@@ -266,19 +268,23 @@ function on_click_card(evt) { if (send_action('card', card)) {
evt.stopPropagation();
}
- } else if (is_action('card_select', card)) {
- console.log('in action card_select')
- show_popup_menu(evt, "popup_select_card", 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('send_action failed for card:', card);
+ console.log('in action card_my_event')
+ show_popup_menu(evt, "popup", card, cards[card].name)
}
}
}
function is_action(action) {
//console.log('is_action called with: ', action)
- //console.log('view.actions', view.actions)
+ console.log('view.actions', view.actions)
if (view.actions && view.actions[action])
return true
return false
|