cm-chessboard 3.16.7 → 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.
package/package.json
CHANGED
|
@@ -148,7 +148,7 @@ export class ChessboardMoveInput {
|
|
|
148
148
|
})
|
|
149
149
|
} else {
|
|
150
150
|
this.view.drawPieces(this.chessboard.state.squares)
|
|
151
|
-
this.view.animationQueue = [] // remove all animations (See PR #59)
|
|
151
|
+
// this.view.animationQueue = [] // todo remove all animations (See PR #59)
|
|
152
152
|
this.setMoveInputState(STATE.reset)
|
|
153
153
|
}
|
|
154
154
|
} else {
|
|
@@ -335,13 +335,21 @@ export class ChessboardView {
|
|
|
335
335
|
nextPieceAnimationInQueue() {
|
|
336
336
|
const nextAnimation = this.animationQueue.shift()
|
|
337
337
|
if (nextAnimation !== undefined) {
|
|
338
|
-
this.drawPieces(nextAnimation.fromSquares)
|
|
339
338
|
this.animationRunning = true
|
|
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
|
}
|