Some changes to the logic in Rules.vue: weird behavior, TODO
[vchess.git] / client / src / components / BaseGame.vue
index 83311cc..f10420d 100644 (file)
       p#fenString.text-center {{ vr.getFen() }}
     #pgnDiv.section-content
       a#download(href="#")
-      .button-group
-        button#downloadBtn(@click="download") {{ st.tr["Download PGN"] }}
-        // TODO: Import game button copy game locally in IndexedDB
-        //button Import game
-    //MoveList(v-if="showMoves"
-      :moves="moves" :cursor="cursor" @goto-move="gotoMove")
+      button#downloadBtn(@click="download") {{ st.tr["Download PGN"] }}
+    div#movesList
+      MoveList(v-if="showMoves"
+        :moves="moves" :cursor="cursor" @goto-move="gotoMove")
 </template>
 
 <script>
 import Board from "@/components/Board.vue";
-//import MoveList from "@/components/MoveList.vue";
+import MoveList from "@/components/MoveList.vue";
 import { store } from "@/store";
 import { getSquareId } from "@/utils/squareId";
 import { getDate } from "@/utils/datetime";
@@ -40,7 +38,7 @@ export default {
   name: 'my-base-game',
   components: {
     Board,
-    //MoveList,
+    MoveList,
   },
   // "vr": VariantRules object, describing the game state + rules
   props: ["vr","game"],
@@ -61,6 +59,9 @@ export default {
     "game.fenStart": function() {
       this.re_setVariables();
     },
+    "game.score": function() {
+      this.score = this.game.score;
+    },
   },
   computed: {
     showMoves: function() {
@@ -71,7 +72,7 @@ export default {
       return this.game.vname != "Dark" || this.score != "*";
     },
     analyze: function() {
-      return this.game.mode == "analyze" || this.game.score != "*";
+      return this.game.mode == "analyze" || this.score != "*";
     },
   },
   created: function() {