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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cm-chessboard",
3
- "version": "3.16.7",
3
+ "version": "3.16.8",
4
4
  "description": "A JavaScript chessboard which is lightweight, ES6 module based, responsive, SVG rendered and without dependencies.",
5
5
  "keywords": [
6
6
  "chess",
@@ -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.animationRunning = false
342
- this.nextPieceAnimationInQueue()
343
- if (nextAnimation.callback) {
344
- nextAnimation.callback()
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
  }