X-Git-Url: https://git.auder.net/variants/%24%7Bvname%7D/current/git-favicon.png?a=blobdiff_plain;f=client%2Fsrc%2Fcomponents%2FMoveList.vue;h=aa12969aa1c968311d1c2223632dd01bffa569f4;hb=910d631b73cad5ffef1b4461157b704e7e7057d8;hp=73c10f0fbf771c87084fa030e009effa547aab71;hpb=144c900354f828ff2321a94db364bf436bff4586;p=vchess.git diff --git a/client/src/components/MoveList.vue b/client/src/components/MoveList.vue index 73c10f0f..aa12969a 100644 --- a/client/src/components/MoveList.vue +++ b/client/src/components/MoveList.vue @@ -1,3 +1,130 @@ + + + + + error + newValue = 0; //avoid rows[-1] => error // $nextTick to wait for table > tr to be rendered this.$nextTick( () => { let rows = document.querySelectorAll('#movesList tr'); @@ -44,24 +170,8 @@ export default { }, }, computed: { - groupedMoves: function() { - let groups = []; - let curCol = undefined; - for (let idx=0; idx < this.moves.length; idx++) - { - const m = this.moves[idx]; - if (m.color == curCol) - { - const gidx = groups.length - 1; - groups[gidx].moves.push(m); - } - else - { - curCol = m.color; - groups.push({moves: [m], idx: groups.length}); - } - } - return groups; + evenNumbers: function() { + return [...Array(this.moves.length).keys()].filter(i => i%2==0); }, }, methods: { @@ -71,18 +181,4 @@ export default { }, }; - - +-->