2 // Component for moves list on the right
5 props: ["moves","cursor"],
7 if (this.moves.length == 0)
11 let tableRow = undefined;
12 let moveCells = undefined;
13 let curCellContent = "";
14 for (let i=0; i<this.moves.length; i++)
16 if (this.moves[i].color == "w")
18 if (i == 0 || i>0 && this.moves[i-1].color=="b")
22 tableRow.children = moveCells;
23 tableContent.push(tableRow);
28 { domProps: { innerHTML: (++moveCounter) + "." } }
38 curCellContent += this.moves[i].notation;
39 if (i < this.moves.length-1 && this.moves[i+1].color == this.moves[i].color)
40 curCellContent += ",";
47 domProps: { innerHTML: curCellContent },
48 on: { click: () => this.gotoMove(i) },
49 "class": { "highlight-lm": this.cursor == i },
56 // Complete last row, which might not be full:
57 if (moveCells.length-1 == 1)
62 { domProps: { innerHTML: "" } }
66 tableRow.children = moveCells;
67 tableContent.push(tableRow);
84 gotoMove: function(index) {
85 this.$emit("goto-move", index);
91 <style lang="sass" scoped>