cm-chessboard 3.16.5 → 3.16.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -105,6 +105,7 @@ board.enableMoveInput(inputHandler, COLOR.white)
|
|
|
105
105
|
|
|
106
106
|
const board = new Chessboard(document.getElementById("board"), {
|
|
107
107
|
position: chess.fen(),
|
|
108
|
+
// animationDuration: 2000,
|
|
108
109
|
sprite: {url: "../assets/images/chessboard-sprite-staunty.svg"},
|
|
109
110
|
style: {moveFromMarker: undefined, moveToMarker: undefined}, // disable standard markers
|
|
110
111
|
orientation: COLOR.white
|
|
@@ -112,4 +113,4 @@ board.enableMoveInput(inputHandler, COLOR.white)
|
|
|
112
113
|
board.enableMoveInput(inputHandler, COLOR.white)
|
|
113
114
|
</script>
|
|
114
115
|
</body>
|
|
115
|
-
</html>
|
|
116
|
+
</html>
|
package/favicon.ico
ADDED
|
Binary file
|
package/index.html
CHANGED
package/package.json
CHANGED
|
@@ -67,7 +67,7 @@ export class ChessboardView {
|
|
|
67
67
|
destroy() {
|
|
68
68
|
this.moveInput.destroy()
|
|
69
69
|
if (this.resizeObserver) {
|
|
70
|
-
this.resizeObserver.unobserve(this.chessboard.element)
|
|
70
|
+
this.resizeObserver.unobserve(this.chessboard.element)
|
|
71
71
|
}
|
|
72
72
|
if (this.resizeListener) {
|
|
73
73
|
window.removeEventListener("resize", this.resizeListener)
|
|
@@ -336,12 +336,20 @@ export class ChessboardView {
|
|
|
336
336
|
const nextAnimation = this.animationQueue.shift()
|
|
337
337
|
if (nextAnimation !== undefined) {
|
|
338
338
|
this.animationRunning = true
|
|
339
|
-
this.drawPieces(nextAnimation.fromSquares);
|
|
340
339
|
this.currentAnimation = new ChessboardPiecesAnimation(this, nextAnimation.fromSquares, nextAnimation.toSquares, this.chessboard.props.animationDuration / (this.animationQueue.length + 1), () => {
|
|
341
|
-
this.
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
340
|
+
if (!this.moveInput.draggablePiece) {
|
|
341
|
+
this.drawPieces(nextAnimation.toSquares)
|
|
342
|
+
this.animationRunning = false
|
|
343
|
+
this.nextPieceAnimationInQueue()
|
|
344
|
+
if (nextAnimation.callback) {
|
|
345
|
+
nextAnimation.callback()
|
|
346
|
+
}
|
|
347
|
+
} else {
|
|
348
|
+
this.animationRunning = false
|
|
349
|
+
this.nextPieceAnimationInQueue()
|
|
350
|
+
if (nextAnimation.callback) {
|
|
351
|
+
nextAnimation.callback()
|
|
352
|
+
}
|
|
345
353
|
}
|
|
346
354
|
})
|
|
347
355
|
}
|