fix dblckick on tile in Chromium
This commit is contained in:
parent
ad5ac4f2e6
commit
d5f4d913db
|
@ -275,7 +275,27 @@
|
|||
return null;
|
||||
}
|
||||
|
||||
function cleanupDragTile() {
|
||||
mouseUp(document, dragTileEnd, true);
|
||||
mouseMove(document, dragTileMove, true);
|
||||
|
||||
tileInitMouseCoords = null;
|
||||
tileInitCoords = null;
|
||||
tileInitDest = null;
|
||||
tileDest = null;
|
||||
movingTile = null;
|
||||
boardBCR = null;
|
||||
bagBCR = null;
|
||||
rackBCR = null;
|
||||
moveCMD = null;
|
||||
}
|
||||
|
||||
function dragTileEnd() {
|
||||
if (movingTile.parentNode === tileInitDest) {
|
||||
cleanupDragTile();
|
||||
return;
|
||||
}
|
||||
|
||||
movingTile.style.left = "";
|
||||
movingTile.style.top = "";
|
||||
movingTile.style.width = "";
|
||||
|
@ -293,9 +313,6 @@
|
|||
delete currentTilePlayed[moveCMD.indexFrom];
|
||||
}
|
||||
|
||||
mouseUp(document, dragTileEnd, true);
|
||||
mouseMove(document, dragTileMove, true);
|
||||
|
||||
if (tileDest === bag) {
|
||||
moveCMD.to = "bag";
|
||||
moveCMD.indexTo = -1;
|
||||
|
@ -349,18 +366,18 @@
|
|||
}
|
||||
}
|
||||
|
||||
tileInitMouseCoords = null;
|
||||
tileInitCoords = null;
|
||||
tileInitDest = null;
|
||||
tileDest = null;
|
||||
movingTile = null;
|
||||
boardBCR = null;
|
||||
bagBCR = null;
|
||||
rackBCR = null;
|
||||
moveCMD = null;
|
||||
cleanupDragTile();
|
||||
}
|
||||
|
||||
function dragTileMove(e) {
|
||||
if (movingTile.parentNode !== document.body) {
|
||||
movingTile.style.left = tileInitCoords.left + window.scrollX + "px";
|
||||
movingTile.style.top = tileInitCoords.top + window.scrollY + "px";
|
||||
movingTile.style.width = tileInitCoords.width + "px";
|
||||
movingTile.style.height = tileInitCoords.height + "px";
|
||||
document.body.appendChild(movingTile);
|
||||
}
|
||||
|
||||
let newLeft = (tileInitCoords.left + (e.clientX - tileInitMouseCoords.clientX));
|
||||
let newTop = (tileInitCoords.top + (e.clientY - tileInitMouseCoords.clientY));
|
||||
|
||||
|
@ -542,13 +559,6 @@
|
|||
|
||||
mouseMove(document, dragTileMove);
|
||||
mouseUp(document, dragTileEnd);
|
||||
|
||||
movingTile.style.left = tileInitCoords.left + window.scrollX + "px";
|
||||
movingTile.style.top = tileInitCoords.top + window.scrollY + "px";
|
||||
movingTile.style.width = tileInitCoords.width + "px";
|
||||
movingTile.style.height = tileInitCoords.height + "px";
|
||||
|
||||
document.body.appendChild(movingTile);
|
||||
}
|
||||
|
||||
function setLetter(tile, letter, highlight) {
|
||||
|
|
Loading…
Reference in New Issue