Better style for corr moves confirmation (see board)
[vchess.git] / client / src / components / MoveList.vue
index 4357098..6e3a90d 100644 (file)
@@ -77,6 +77,12 @@ export default {
     document.getElementById("adjuster").addEventListener(
       "click",
       processModalClick);
+    if ("ontouchstart" in window) {
+      // Disable tooltips on smartphones:
+      document.getElementsByClassName("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"
           });
@@ -219,4 +224,7 @@ span#rulesBtn
 
 button
   margin: 0
+
+button.tooltip
+  padding-bottom: 5px
 </style>