X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=public%2Fjavascripts%2Fcomponents%2FmoveList.js;h=48a8e05c4ba1edd521e1b38b1b947d9ef9ecfd7d;hb=b955c65b942d09d24b5c3bed0d755d4f2f8f71f1;hp=b3c4255fa2407bb4b043628196436f05b245c4b6;hpb=7d9e99bc177972c5af8b1b45f4bfb043d8306f30;p=vchess.git diff --git a/public/javascripts/components/moveList.js b/public/javascripts/components/moveList.js index b3c4255f..48a8e05c 100644 --- a/public/javascripts/components/moveList.js +++ b/public/javascripts/components/moveList.js @@ -1,15 +1,14 @@ -//TODO: component for moves list on the right -// TODO: generic "getPGN" in the same way (following move.color) +// Component for moves list on the right Vue.component('my-move-list', { props: ["moves","cursor"], //TODO: other props for e.g. players names + connected indicator // --> we could also add turn indicator here - // + missing "cursor" prop data: function() { return { - something: "", //TODO + something: "", //TODO? }; }, // TODO: extend rendering for more than 2 colors: would be a parameter + // in that case some moves for some colors could be just skipped (if a player lost) render(h) { if (this.moves.length == 0) return; @@ -57,7 +56,7 @@ Vue.component('my-move-list', { { domProps: { innerHTML: curCellContent }, on: { click: () => this.gotoMove(i) }, - "class": { "highlight-lm": this.cursor-1 == i }, + "class": { "highlight-lm": this.cursor == i }, } ) );