cm-chessboard 8.12.0 → 8.12.2
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/README.md
CHANGED
|
@@ -47,7 +47,7 @@ The core of cm-chessboard is small, fast and reduced to the essentials. You can
|
|
|
47
47
|
#### Step 2a: Include the CSS file
|
|
48
48
|
|
|
49
49
|
```html
|
|
50
|
-
<link rel="stylesheet" href="./node_modules/cm-chessboard/assets/
|
|
50
|
+
<link rel="stylesheet" href="./node_modules/cm-chessboard/assets/chessboard.css">
|
|
51
51
|
```
|
|
52
52
|
|
|
53
53
|
- Some extensions, like "[Markers](https://shaack.com/projekte/cm-chessboard/examples/extensions/markers-extension.html)", "[Promotion Dialog](https://shaack.com/projekte/cm-chessboard/examples/extensions/promotion-dialog-extension.html)" or "[Arrows](https://shaack.com/projekte/cm-chessboard/examples/extensions/arrows-extension.html)" need additional CSS. See the examples.
|
package/package.json
CHANGED
|
@@ -43,6 +43,7 @@ export class Arrows extends Extension {
|
|
|
43
43
|
chessboard.getArrows = this.getArrows.bind(this)
|
|
44
44
|
chessboard.removeArrows = this.removeArrows.bind(this)
|
|
45
45
|
this.arrowGroup = Svg.addElement(chessboard.view.markersTopLayer, "g", {class: "arrows"})
|
|
46
|
+
this.instanceId = Math.random().toString(36).slice(2, 10)
|
|
46
47
|
this.arrows = []
|
|
47
48
|
}
|
|
48
49
|
|
|
@@ -74,7 +75,7 @@ export class Arrows extends Extension {
|
|
|
74
75
|
const ptTo = view.squareToPoint(arrow.to)
|
|
75
76
|
const spriteUrl = this.chessboard.props.assetsCache ? "" : this.getSpriteUrl()
|
|
76
77
|
const defs = Svg.addElement(arrowsGroup, "defs")
|
|
77
|
-
const id = "arrow-" + arrow.from + arrow.to
|
|
78
|
+
const id = "arrow-" + this.instanceId + "-" + arrow.from + arrow.to
|
|
78
79
|
const marker = Svg.addElement(defs, "marker", {
|
|
79
80
|
id: id,
|
|
80
81
|
markerWidth: this.props.headSize,
|