X-Git-Url: https://git.auder.net/?p=xogo.git;a=blobdiff_plain;f=base_rules.js;h=ad30c0a04cd97d376d252adb1a6f0428b0fd3a34;hp=ea34a3d806d1c26b2a645d88c1a6bdf730f86f9f;hb=5abaabb3061f9c2927e2204a33a58c309f3a0082;hpb=65c770d1d8b4b1d6fe3beae9f0ada4bf8f8856cb diff --git a/base_rules.js b/base_rules.js index ea34a3d..ad30c0a 100644 --- a/base_rules.js +++ b/base_rules.js @@ -415,6 +415,7 @@ export default class ChessRules { // Graphical (can use variables defined above) this.containerId = o.element; + this.isDiagram = o.diagram; this.graphicalInit(); } @@ -561,7 +562,8 @@ export default class ChessRules { window.onresize = () => this.re_drawBoardElements(); const g_init = () => { this.re_drawBoardElements(); - this.initMouseEvents(); + if (!this.isDiagram) + this.initMouseEvents(); }; let container = document.getElementById(this.containerId); if (container.getBoundingClientRect().width == 0) { @@ -655,6 +657,7 @@ export default class ChessRules { } setupPieces(r) { + // TODO: d_pieces : only markers (for diagrams) / also in rescale() if (this.g_pieces) { // Refreshing: delete old pieces first for (let i=0; i { document.removeEventListener(ml.type, ml.listener);