cm-chessboard 3.16.5 → 3.16.6

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
@@ -43,4 +43,4 @@
43
43
  <li><a href="test/">Run the unit tests</a></li>
44
44
  </ul>
45
45
  </body>
46
- </html>
46
+ </html>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cm-chessboard",
3
- "version": "3.16.5",
3
+ "version": "3.16.6",
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,6 +148,7 @@ export class ChessboardMoveInput {
148
148
  })
149
149
  } else {
150
150
  this.view.drawPieces(this.chessboard.state.squares)
151
+ this.view.animationQueue.shift()
151
152
  this.setMoveInputState(STATE.reset)
152
153
  }
153
154
  } else {
@@ -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)
@@ -335,8 +335,8 @@ export class ChessboardView {
335
335
  nextPieceAnimationInQueue() {
336
336
  const nextAnimation = this.animationQueue.shift()
337
337
  if (nextAnimation !== undefined) {
338
+ this.drawPieces(nextAnimation.fromSquares)
338
339
  this.animationRunning = true
339
- this.drawPieces(nextAnimation.fromSquares);
340
340
  this.currentAnimation = new ChessboardPiecesAnimation(this, nextAnimation.fromSquares, nextAnimation.toSquares, this.chessboard.props.animationDuration / (this.animationQueue.length + 1), () => {
341
341
  this.animationRunning = false
342
342
  this.nextPieceAnimationInQueue()