Hi,
I dont understand why but on my actual project when i used addActionButton
the generated id isn't what i expected. Id is similar to an another player Id (present on table)
i make multiple test (and reset my JS to exclude some other interaction) whithout result. in addition When i click one button twice events is triggered
Thx !
____ EDIT
The problem is solved by reset code in .view.php
i hope it's helping
I dont understand why but on my actual project when i used addActionButton
Code: Select all
onUpdateActionButtons: function (stateName, args)
{
console.log('onUpdateActionButtons: ' + stateName);
if (this.isCurrentPlayerActive())
{
switch (stateName)
{
case "playerTurn":
this.addActionButton('button_1_id', _('Play cards'), 'doDraw', null, false, 'blue');
this.addActionButton('button_2_id', _('Reset'), 'doDraw1', null, false, 'red');
break;
}
}
Code: Select all
<div id="generalactions">
<a href="#" class="action-button bgabutton bgabutton_blue" onclick="return false;" id="$2351196">Play cards</a>
<a href="#" class="action-button bgabutton bgabutton_red" onclick="return false;" id="$2351196">Reset</a>
</div>
Thx !
____ EDIT
The problem is solved by reset code in .view.php
i hope it's helping