X-Git-Url: https://git.auder.net/assets/icon_infos.svg?a=blobdiff_plain;f=client%2Fsrc%2Fviews%2FGame.vue;h=6d506c5fb18de830255208536d516c4b0cbbc694;hb=13d00ef164983c0e0a42b739a13bdc9eb3f1d21e;hp=0d9cba228c04785202efb8f86833116168654eca;hpb=5b18515f0b7dbfab8a2770d9b0fc7aace09267dc;p=vchess.git diff --git a/client/src/views/Game.vue b/client/src/views/Game.vue index 0d9cba22..6d506c5f 100644 --- a/client/src/views/Game.vue +++ b/client/src/views/Game.vue @@ -97,13 +97,13 @@ main ) img(src="/images/icons/draw.svg") button.tooltip( - v-if="!!game.mycolor" + v-show="!!game.mycolor" @click="abortGame()" :aria-label="st.tr['Abort']" ) img(src="/images/icons/abort.svg") button.tooltip( - v-if="!!game.mycolor" + v-show="!!game.mycolor" @click="resign()" :aria-label="st.tr['Resign']" ) @@ -270,12 +270,6 @@ export default { .addEventListener("click", processModalClick); } ); - if ("ontouchstart" in window) { - // Disable tooltips on smartphones: - document.querySelectorAll("#aboveBoard .tooltip").forEach(elt => { - elt.classList.remove("tooltip"); - }); - } }, beforeDestroy: function() { this.cleanBeforeDestroy(); @@ -1213,6 +1207,17 @@ export default { }, game ); + if ("ontouchstart" in window) { + this.$nextTick(() => { + // Disable tooltips on smartphones: + document.querySelectorAll("#aboveBoard .tooltip").forEach(elt => { + +alert(elt); + + elt.classList.remove("tooltip"); + }); + }); + } this.$refs["basegame"].re_setVariables(this.game); if (!this.gameIsLoading) { // Initial loading: @@ -1565,6 +1570,15 @@ export default { // In corr games, callback to change page only after score is set: gameOver: function(score, scoreMsg, callback) { this.game.score = score; + if ("ontouchstart" in window) { + this.$nextTick(() => { + // Disable tooltips on smartphones + // (might be required for rematch button at least): + document.querySelectorAll("#aboveBoard .tooltip").forEach(elt => { + elt.classList.remove("tooltip"); + }); + }); + } if (!scoreMsg) scoreMsg = getScoreMessage(score); this.game.scoreMsg = scoreMsg; document.getElementById("modalRules").checked = false;