X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fcomponents%2FMoveList.vue;h=6f2eb317d4344daf932a08b5dfc598f5ac75900c;hb=407342b67c1e7a72f2ac1cfb176440bb138ffdfb;hp=228971a9bd6d16bfea77a460aca36e76d75375e2;hpb=0cc44e583fd266eab65f1c9cb0fd79d07d99d319;p=vchess.git diff --git a/client/src/components/MoveList.vue b/client/src/components/MoveList.vue index 228971a9..6f2eb317 100644 --- a/client/src/components/MoveList.vue +++ b/client/src/components/MoveList.vue @@ -77,6 +77,12 @@ export default { document.getElementById("adjuster").addEventListener( "click", processModalClick); + if ("ontouchstart" in window) { + // Disable tooltips on smartphones: + document.querySelectorAll("#aboveMoves .tooltip").forEach(elt => { + elt.classList.remove("tooltip"); + }); + } // Take full width on small screens: let boardSize = parseInt(localStorage.getItem("boardSize")); if (!boardSize) { @@ -109,7 +115,10 @@ export default { // $nextTick to wait for table > tr to be rendered this.$nextTick(() => { let curMove = document.querySelector(".td.highlight-lm"); - if (curMove) { + if (!curMove && this.moves.length > 0) + // Cursor is before game beginning, and some moves were made: + curMove = document.querySelector(".moves-list > .tr:first-child > .td"); + if (!!curMove) { curMove.scrollIntoView({ behavior: "auto", block: "nearest" @@ -215,4 +224,7 @@ span#rulesBtn button margin: 0 + +button.tooltip + padding-bottom: 5px