X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fcomponents%2FMoveList.vue;h=eb47dc9016adecf4b2595b52884dc5d480630142;hb=28b32b4fc7c23b1c72bed68e1897576c5be46c3d;hp=43570984a2c2495841e3919f1d702270ef22df01;hpb=c51c301fdff91790e80de7f7431a596732780fb5;p=vchess.git diff --git a/client/src/components/MoveList.vue b/client/src/components/MoveList.vue index 43570984..eb47dc90 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) { @@ -108,13 +114,12 @@ export default { 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: - curLine = document.querySelector(".moves-list .tr:first-child") - if (!!curLine) { - curLine.scrollIntoView({ + curMove = document.querySelector(".moves-list > .tr:first-child > .td"); + if (!!curMove) { + curMove.scrollIntoView({ behavior: "auto", block: "nearest" }); @@ -155,6 +160,7 @@ export default {