projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix Horde variant + a bug when socket is not ready in Hall and Game send() method
[vchess.git]
/
client
/
src
/
components
/
MoveList.vue
diff --git
a/client/src/components/MoveList.vue
b/client/src/components/MoveList.vue
index
140b71c
..
6eaf43c
100644
(file)
--- a/
client/src/components/MoveList.vue
+++ b/
client/src/components/MoveList.vue
@@
-53,7
+53,7
@@
div
| {{ notation(moves[moveIdx]) }}
.td(
v-if="moveIdx < moves.length-1"
| {{ notation(moves[moveIdx]) }}
.td(
v-if="moveIdx < moves.length-1"
- :class="{'highlight-lm':
cursor == moveIdx+1
}"
+ :class="{'highlight-lm':
highlightBlackmove(moveIdx+1)
}"
@click="() => gotoMove(moveIdx+1)"
)
| {{ notation(moves[moveIdx+1]) }}
@click="() => gotoMove(moveIdx+1)"
)
| {{ notation(moves[moveIdx+1]) }}
@@
-114,9
+114,11
@@
export default {
// $nextTick to wait for table > tr to be rendered
this.$nextTick(() => {
let curMove = document.querySelector(".td.highlight-lm");
// $nextTick to wait for table > tr to be rendered
this.$nextTick(() => {
let curMove = document.querySelector(".td.highlight-lm");
- if (!curMove && this.moves.length > 0)
+ if (!curMove && this.moves.length > 0)
{
// Cursor is before game beginning, and some moves were made:
// Cursor is before game beginning, and some moves were made:
- curMove = document.querySelector(".moves-list > .tr:first-child > .td");
+ curMove =
+ document.querySelector(".moves-list > .tr:first-child > .td");
+ }
if (!!curMove) {
curMove.scrollIntoView({
behavior: "auto",
if (!!curMove) {
curMove.scrollIntoView({
behavior: "auto",
@@
-135,6
+137,12
@@
export default {
notation: function(move) {
return getFullNotation(move);
},
notation: function(move) {
return getFullNotation(move);
},
+ highlightBlackmove: function(moveIdx) {
+ return (
+ this.cursor == moveIdx ||
+ (this.show == "byrow" && this.cursor == moveIdx + 1)
+ );
+ },
gotoMove: function(index) {
this.$emit("goto-move", index);
},
gotoMove: function(index) {
this.$emit("goto-move", index);
},