Fix moves list scrolling. Seemingly a remaining issue in SynchroneChess... (kings...
authorBenjamin Auder <benjamin.auder@somewhere>
Tue, 24 Mar 2020 03:23:27 +0000 (04:23 +0100)
committerBenjamin Auder <benjamin.auder@somewhere>
Tue, 24 Mar 2020 03:23:27 +0000 (04:23 +0100)
client/src/components/MoveList.vue

index 140b71c..2bad301 100644 (file)
@@ -53,7 +53,7 @@ div
         | {{ notation(moves[moveIdx]) }}
       .td(
         v-if="moveIdx < moves.length-1"
-        :class="{'highlight-lm': cursor == moveIdx+1}"
+        :class="{'highlight-lm': highlightBlackmove(moveIdx)}"
         @click="() => gotoMove(moveIdx+1)"
       )
         | {{ notation(moves[moveIdx+1]) }}
@@ -135,6 +135,12 @@ export default {
     notation: function(move) {
       return getFullNotation(move);
     },
+    highlightBlackmove: function(moveIdx) {
+      return (
+        this.cursor == moveIdx + 1 ||
+        (this.show == "byrow" && this.cursor == moveIdx + 2)
+      );
+    },
     gotoMove: function(index) {
       this.$emit("goto-move", index);
     },