)
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']"
)
.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();
GameStorage.update(this.gameRef, { drawOffer: "" });
}
}
- this.$refs["basegame"].play(
- movePlus.move, "received", null, true);
+ this.$refs["basegame"].play(movePlus.move, "received");
this.game.clocks[moveColIdx] = movePlus.clock;
this.processMove(
movePlus.move,
this.$router.push("/game/" + gameInfo.id);
} else {
this.rematchId = gameInfo.id;
+ document.getElementById("modalRules").checked = false;
+ document.getElementById("modalScore").checked = false;
document.getElementById("modalRematch").checked = true;
}
break;
this.game.clocks[oppIdx] = data.clock;
if (data.movesCount > L) {
// Just got last move from him
- this.$refs["basegame"].play(data.lastMove, "received", null, true);
+ this.$refs["basegame"].play(data.lastMove, "received");
this.processMove(data.lastMove);
} else {
if (!!this.clockUpdate) clearInterval(this.clockUpdate);
},
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:
// 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;
// Display result in a un-missable way:
document.getElementById("modalScore").checked = true;
this.$set(this.game, "scoreMsg", scoreMsg);
<style lang="sass" scoped>
#scoreDiv > .card, #rematchDiv > .card
- padding: 15px 0
+ padding: 10px 0
max-width: 430px
#rulesDiv > .card
max-width: 100%
p.score-section
+ margin: 0
font-size: 1.3em
span.score
font-weight: bold