X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=public%2Fjavascripts%2Fcomponents%2Fgame.js;h=ca791257eb51360853575f0b208587c2e2a35cea;hp=39c12c0e283513bf622fe6d3bbba2e235e09ce3e;hb=fd08ab2c5b8931bb8c95cf7e9f2f95122647f991;hpb=2305d34a3f2ab561c20b1fcb7349320145ac1f5c diff --git a/public/javascripts/components/game.js b/public/javascripts/components/game.js index 39c12c0e..ca791257 100644 --- a/public/javascripts/components/game.js +++ b/public/javascripts/components/game.js @@ -4,7 +4,7 @@ // Game logic on a variant page: 3 modes, analyze, computer or human Vue.component('my-game', { // gameId: to find the game in storage (assumption: it exists) - props: ["gameId","mode","allowChat","allowMovelist"], + props: ["gameId","fen","mode","allowChat","allowMovelist"], data: function() { return { // if oppid == "computer" then mode = "computer" (otherwise human) @@ -24,6 +24,11 @@ Vue.component('my-game', { vr: null, //VariantRules object, describing the game state + rules }; }, + watch: { + fen: function(newFen) { + this.vr = new VariantRules(newFen); + }, + }, computed: { showChat: function() { return this.allowChat && this.mode=='human' && this.score != '*';