X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fcomponents%2FMoveList.vue;h=2bad3014fd237be44bb9316dbf8b73f11304fde8;hb=08a5069cbf419f204b69135a0860ba6d53affb7f;hp=da70e3490686b6eec83d7d63347c11d09eb4f252;hpb=3c18611517fa137f089cbd866cbc8d3f4cc07735;p=vchess.git diff --git a/client/src/components/MoveList.vue b/client/src/components/MoveList.vue index da70e349..2bad3014 100644 --- a/client/src/components/MoveList.vue +++ b/client/src/components/MoveList.vue @@ -27,6 +27,12 @@ div :aria-label="st.tr['Resize board']" ) img.inline(src="/images/icons/resize.svg") + button.tooltip( + v-if="canAnalyze" + @click="$emit('analyze')" + :aria-label="st.tr['Analyse']" + ) + img.inline(src="/images/icons/analyse.svg") #downloadDiv(v-if="canDownload") a#download(href="#") button.tooltip( @@ -34,12 +40,6 @@ div :aria-label="st.tr['Download'] + ' PGN'" ) img.inline(src="/images/icons/download.svg") - button.tooltip( - v-if="canAnalyze" - @click="$emit('analyze')" - :aria-label="st.tr['Analyse']" - ) - img.inline(src="/images/icons/analyse.svg") #scoreInfo(v-if="score!='*'") span.score {{ score }} span.score-msg {{ st.tr[message] }} @@ -53,7 +53,7 @@ div | {{ notation(moves[moveIdx]) }} .td( v-if="moveIdx < moves.length-1" - :class="{'highlight-lm': cursor == moveIdx+1}" + :class="{'highlight-lm': highlightBlackmove(moveIdx)}" @click="() => gotoMove(moveIdx+1)" ) | {{ notation(moves[moveIdx+1]) }} @@ -74,9 +74,14 @@ export default { }; }, mounted: function() { - document.getElementById("adjuster").addEventListener( - "click", - processModalClick); + 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) { @@ -130,6 +135,12 @@ export default { notation: function(move) { return getFullNotation(move); }, + highlightBlackmove: function(moveIdx) { + return ( + this.cursor == moveIdx + 1 || + (this.show == "byrow" && this.cursor == moveIdx + 2) + ); + }, gotoMove: function(index) { this.$emit("goto-move", index); }, @@ -154,6 +165,7 @@ export default {