cm-chessboard 5.4.7 → 5.4.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.
@@ -22,8 +22,9 @@
22
22
  import {Chessboard, COLOR, INPUT_EVENT_TYPE} from "../../src/cm-chessboard/Chessboard.js"
23
23
  import {PromotionDialog} from "../../src/cm-chessboard/extensions/promotion-dialog/PromotionDialog.js"
24
24
 
25
+ const position = "4k3/1P6/8/8/6r1/8/8/2R1K3 w - - 0 1"
25
26
  const chessboard = new Chessboard(document.getElementById("chessboard"), {
26
- position: "4k3/1P6/8/8/6r1/8/8/2R1K3 w - - 0 1",
27
+ position: position,
27
28
  sprite: {
28
29
  url: "../../assets/images/chessboard-sprite.svg", // pieces and markers are stored in a sprite file
29
30
  },
@@ -39,6 +40,8 @@
39
40
  console.log("48a99d Piece selected", event.piece)
40
41
  if(event.piece) {
41
42
  chessboard.setPiece(event.square, event.piece, true)
43
+ } else {
44
+ chessboard.setPosition(position)
42
45
  }
43
46
  })
44
47
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cm-chessboard",
3
- "version": "5.4.7",
3
+ "version": "5.4.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",