Fix the empty rack button

This commit is contained in:
Raphaël Jakse 2020-10-05 23:46:47 +02:00
parent 10c8868742
commit cc28f3683e
1 changed files with 15 additions and 9 deletions

View File

@ -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("");
}
);