X-Git-Url: https://git.auder.net/variants/%24%7Bvname%7D/current/git-favicon.png?a=blobdiff_plain;f=client%2Fsrc%2Fcomponents%2FMoveList.vue;h=43570984a2c2495841e3919f1d702270ef22df01;hb=c51c301fdff91790e80de7f7431a596732780fb5;hp=6f7b4dce56c11c14ab14af828c12f840cacb8af1;hpb=feaf1bf73fa8c6054e353585dee0b8a4fdcfbc4e;p=vchess.git diff --git a/client/src/components/MoveList.vue b/client/src/components/MoveList.vue index 6f7b4dce..43570984 100644 --- a/client/src/components/MoveList.vue +++ b/client/src/components/MoveList.vue @@ -108,9 +108,13 @@ export default { if (window.innerWidth <= 767) return; //scrolling would hide chessboard // $nextTick to wait for table > tr to be rendered this.$nextTick(() => { - let curMove = document.querySelector(".td.highlight-lm"); - if (curMove) { - curMove.scrollIntoView({ + let curLine = document.querySelector(".td.highlight-lm"); + if (!!curLine) curLine = curLine.parentNode; + if (!curLine && this.moves.length > 0) + // Cursor is before game beginning, and some moves were made: + curLine = document.querySelector(".moves-list .tr:first-child") + if (!!curLine) { + curLine.scrollIntoView({ behavior: "auto", block: "nearest" }); @@ -188,6 +192,11 @@ img.inline @media screen and (max-width: 767px) height: 18px +#scoreInfo + margin: 10px 0 + @media screen and (max-width: 767px) + margin: 5px 0 + span.score display: inline-block margin-left: 10px