X-Git-Url: https://git.auder.net/img/rock_paper_scissors_lizard_spock.gif?a=blobdiff_plain;f=client%2Fsrc%2Fcomponents%2FBaseGame.vue;h=e880de5f4abde0246dc8bc1cca8e3e11d880fc81;hb=603b8a8b4a854efb168953da70e7b43ae99b50d9;hp=a2d78a069d959660b3284be5d1c8aa559172366d;hpb=7aa548e72ba8a4af4e2c7f63e7723ad10d2cd3a4;p=vchess.git diff --git a/client/src/components/BaseGame.vue b/client/src/components/BaseGame.vue index a2d78a06..e880de5f 100644 --- a/client/src/components/BaseGame.vue +++ b/client/src/components/BaseGame.vue @@ -17,7 +17,7 @@ div button(@click="gotoBegin") GotoBegin button(@click="gotoEnd") GotoEnd #fenDiv(v-if="showFen && !!vr") - p {{ vr.getFen() }} + p(@click="gotoFenContent") {{ vr.getFen() }} #pgnDiv a#download(href="#") button(@click="download") {{ st.tr["Download PGN"] }} @@ -62,8 +62,9 @@ export default { "game.moveToPlay": function() { this.play(this.game.moveToPlay, "receive", this.game.vname=="Dark"); }, - "game.score": function() { - this.endGame(this.game.score, this.game.scoreMsg); + "game.score": function(score) { + if (score != "*") + this.endGame(score, this.game.scoreMsg); }, }, computed: { @@ -103,6 +104,10 @@ export default { this.cursor = L-1; this.lastMove = (L > 0 ? this.moves[L-1] : null); }, + gotoFenContent: function(event) { + this.$router.push("/analyze/" + this.game.vname + + "/?fen=" + event.target.innerText.replace(/ /g, "_")); + }, download: function() { const content = this.getPgn(); // Prepare and trigger download link