X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fcomponents%2FMoveList.vue;h=aa12969aa1c968311d1c2223632dd01bffa569f4;hb=58ae6be576fb06302d70eb19815dcb71b765a8b8;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 {
},
};
-
-
+-->