X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fviews%2FGame.vue;h=18a28366f9d1c0d6a2b505c2962cb297a1329097;hb=96aa6f038885b1c0bb04b71c59cb767553051fc8;hp=b39e7d2cb5cf5cd5a67c0786fa06b7d70b22bb11;hpb=407342b67c1e7a72f2ac1cfb176440bb138ffdfb;p=vchess.git diff --git a/client/src/views/Game.vue b/client/src/views/Game.vue index b39e7d2c..18a28366 100644 --- a/client/src/views/Game.vue +++ b/client/src/views/Game.vue @@ -89,7 +89,7 @@ main ) img(src="/images/icons/resign.svg") button.tooltip( - v-else-if="!!game.mycolor" + v-else @click="clickRematch()" :class="{['rematch-' + rematchOffer]: true}" :aria-label="st.tr['Rematch']" @@ -216,9 +216,10 @@ export default { }, mounted: function() { document.addEventListener('visibilitychange', this.visibilityChange); - document - .getElementById("chatWrap") - .addEventListener("click", processModalClick); + ["chatWrap", "infoDiv"].forEach(eltName => { + document.getElementById(eltName) + .addEventListener("click", processModalClick); + }); if ("ontouchstart" in window) { // Disable tooltips on smartphones: document.querySelectorAll("#aboveBoard .tooltip").forEach(elt => { @@ -757,7 +758,7 @@ export default { drawSent: this.drawOffer == "sent", rematchSent: this.rematchOffer == "sent", score: this.game.score, - score: this.game.scoreMsg, + scoreMsg: this.game.scoreMsg, movesCount: L, initime: this.game.initime[1 - myIdx] //relevant only if I played }; @@ -1040,11 +1041,8 @@ export default { }, game, ); - if (this.gameIsLoading) - // Re-load game because we missed some moves: - // artificially reset BaseGame (required if moves arrived in wrong order) - this.$refs["basegame"].re_setVariables(); - else { + this.$refs["basegame"].re_setVariables(this.game); + if (!this.gameIsLoading) { // Initial loading: this.gotMoveIdx = game.moves.length - 1; // If we arrive here after 'nextGame' action, the board might be hidden