projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
scroll to game beginning: better fix
[vchess.git]
/
client
/
src
/
components
/
MoveList.vue
diff --git
a/client/src/components/MoveList.vue
b/client/src/components/MoveList.vue
index
4357098
..
da70e34
100644
(file)
--- a/
client/src/components/MoveList.vue
+++ b/
client/src/components/MoveList.vue
@@
-108,13
+108,12
@@
export default {
if (window.innerWidth <= 767) return; //scrolling would hide chessboard
// $nextTick to wait for table > tr to be rendered
this.$nextTick(() => {
if (window.innerWidth <= 767) return; //scrolling would hide chessboard
// $nextTick to wait for table > tr to be rendered
this.$nextTick(() => {
- let curLine = document.querySelector(".td.highlight-lm");
- if (!!curLine) curLine = curLine.parentNode;
- if (!curLine && this.moves.length > 0)
+ let curMove = document.querySelector(".td.highlight-lm");
+ 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:
- cur
Line = document.querySelector(".moves-list .tr:first-child")
- if (!!cur
Lin
e) {
- cur
Lin
e.scrollIntoView({
+ cur
Move = document.querySelector(".moves-list > .tr:first-child > .td");
+ if (!!cur
Mov
e) {
+ cur
Mov
e.scrollIntoView({
behavior: "auto",
block: "nearest"
});
behavior: "auto",
block: "nearest"
});