- elems.push(
- h("img", {
- "class": {
- piece: true,
- ghost:
- !!this.selectedPiece &&
- this.selectedPiece.parentNode.id == squareId
- },
- attrs: {
- src:
- "/images/pieces/" +
- this.vr.getPpath(
- this.vr.board[ci][cj],
- // Extra args useful for some variants:
- this.userColor,
- this.score,
- this.orientation) +
- V.IMAGE_EXTENSION
- }
- })
- );
+ let pieceSpecs = {
+ "class": {
+ piece: true,
+ ghost:
+ !!this.selectedPiece &&
+ this.selectedPiece.parentNode.id == squareId
+ },
+ attrs: {
+ src:
+ "/images/pieces/" +
+ this.vr.getPpath(
+ this.vr.board[ci][cj],
+ // Extra args useful for some variants:
+ this.userColor,
+ this.score,
+ this.orientation) +
+ V.IMAGE_EXTENSION
+ }
+ };
+ if (this.arrows.length == 0)
+ pieceSpecs["style"] = { position: "absolute" };
+ elems.push(h("img", pieceSpecs));