Fix the empty rack button
This commit is contained in:
parent
10c8868742
commit
cc28f3683e
|
@ -1597,15 +1597,21 @@
|
|||
myConfirm(
|
||||
_("Are you sure you want to put all your tiles back in the bag?"),
|
||||
function () {
|
||||
sendCmds([
|
||||
{cmd: "moveLetter", from: "rack", indexFrom: 0, to: "bag", indexTo: -1},
|
||||
{cmd: "moveLetter", from: "rack", indexFrom: 1, to: "bag", indexTo: -1},
|
||||
{cmd: "moveLetter", from: "rack", indexFrom: 2, to: "bag", indexTo: -1},
|
||||
{cmd: "moveLetter", from: "rack", indexFrom: 3, to: "bag", indexTo: -1},
|
||||
{cmd: "moveLetter", from: "rack", indexFrom: 4, to: "bag", indexTo: -1},
|
||||
{cmd: "moveLetter", from: "rack", indexFrom: 5, to: "bag", indexTo: -1},
|
||||
{cmd: "moveLetter", from: "rack", indexFrom: 6, to: "bag", indexTo: -1}
|
||||
]);
|
||||
const cmds = [];
|
||||
|
||||
for (let i = 0; i < playerLetters.length; i++) {
|
||||
if (playerLetters[i].getElementsByClassName("tile")[0]) {
|
||||
cmds.push({
|
||||
cmd: "moveLetter",
|
||||
from: "rack",
|
||||
indexFrom: i,
|
||||
to: "bag",
|
||||
indexTo: -1
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
sendCmds(cmds);
|
||||
setRack("");
|
||||
}
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue