Added the add button to all sections.
This commit is contained in:
parent
53e5b063f1
commit
9ba77c96fc
@ -80,20 +80,24 @@ function updateEvent() {
|
||||
window.UI.display[handID] = elementPlace("#hands","Hand_"+hand.name,"hand"+(hand.name == window.gameState.active.hand ? " selected" : ""),"li");
|
||||
window.UI.display[handID].controls = elementPlace("#Hand_"+hand.name,null,"controls","div");
|
||||
window.UI.display[handID].controls.innerHTML = "<div>"+hand.name+"</div>";
|
||||
// Muligan Hand
|
||||
// Delete Hand
|
||||
// Muligan Hand
|
||||
// Delete Hand
|
||||
window.UI.display[handID].cards = elementPlace("#Hand_"+hand.name,hand.name+"_cards",null,"ol");
|
||||
hand.cards.forEach(function (card,index) {
|
||||
window.UI.display[handID].cards[index] = elementPlace("#"+hand.name+"_cards",null,"card","li");
|
||||
window.UI.display[handID].cards[index].innerHTML = card;
|
||||
// Play Card
|
||||
// Play Card
|
||||
});
|
||||
window.UI.display[handID].onclick = function () {
|
||||
window.gameState.active.hand = hand.name;
|
||||
updateEvent();
|
||||
}
|
||||
});
|
||||
// Add Hand
|
||||
buttonAdd("#hands",null,"+",function () {
|
||||
popupDialog("addHand","Please name new hand",true, inputDialog,{"inputType":"text"},function (newHandName) {
|
||||
window.gameSession.send('{"action":"add","type":"hand","id":"'+newHandName+'"}');
|
||||
});
|
||||
}, "add_button", "li");
|
||||
}
|
||||
if (window.UI.menu.pools.button.checked) {
|
||||
elementPlace("#display","pools",null,"ol");
|
||||
@ -109,7 +113,11 @@ function updateEvent() {
|
||||
updateEvent();
|
||||
}
|
||||
});
|
||||
// Add Pool
|
||||
buttonAdd("#pools",null,"+",function () {
|
||||
popupDialog("addHand","Please name new pool",true, inputDialog,{"inputType":"text"},function (newPoolName) {
|
||||
window.gameSession.send('{"action":"add","type":"pool","id":"'+newPoolName+'"}');
|
||||
});
|
||||
}, "add_button", "li");
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user