Fixes
authorBenjamin Auder <benjamin.auder@somewhere>
Wed, 29 Jan 2020 13:20:04 +0000 (14:20 +0100)
committerBenjamin Auder <benjamin.auder@somewhere>
Wed, 29 Jan 2020 13:20:04 +0000 (14:20 +0100)
client/src/App.vue
client/src/components/BaseGame.vue
client/src/components/Settings.vue

index c502794..4fc3b48 100644 (file)
@@ -148,6 +148,7 @@ nav
     top: 50px
 
 footer
+  border: 1px solid #ddd
   //background-color: #000033
   font-size: 1rem
   width: 100%
@@ -161,7 +162,8 @@ footer
     margin: 0 10px 0 0
     &:link
       color: #2c3e50
-    &:hover
+    &:visited, &:hover
+      color: #2c3e50
       text-decoration: none
   & > p
     display: inline-block
index e02462e..630c838 100644 (file)
@@ -93,6 +93,8 @@ export default {
       document.getElementById("baseGame").focus();
     },
     handleKeys: function(e) {
+      if ([32,37,38,39,40].includes(e.keyCode))
+        e.preventDefault();
       switch (e.keyCode)
       {
         case 37:
@@ -101,14 +103,13 @@ export default {
         case 39:
           this.play();
           break;
-        case 28:
+        case 38:
           this.gotoBegin();
           break;
         case 40:
           this.gotoEnd();
           break;
         case 32:
-          e.preventDefault();
           this.flip();
           break;
       }
@@ -324,8 +325,16 @@ export default {
     },
     gotoBegin: function() {
       this.vr.re_init(this.game.fenStart);
-      this.cursor = -1;
-      this.lastMove = null;
+      if (this.moves.length > 0 && this.moves[0].notation == "...")
+      {
+        this.cursor = 0;
+        this.lastMove = this.moves[0];
+      }
+      else
+      {
+        this.cursor = -1;
+        this.lastMove = null;
+      }
     },
     gotoEnd: function() {
       this.gotoMove(this.moves.length-1);
index b7dd9b8..4838297 100644 (file)
@@ -34,7 +34,7 @@ div
           option(value="2") {{ st.tr["All"] }}
       fieldset
         .slidecontainer
-          input#myRange.slider(type="range" min="10" max="100" value="55"
+          input#myRange.slider(type="range" min="20" max="100" value="60"
             @input="adjustBoard")
 </template>
 
@@ -46,6 +46,11 @@ export default {
     return {
       st: store.state,
     };
+  },
+  mounted: function() {
+    const boardSize = localStorage.getItem("boardSize");
+    if (!!boardSize)
+      document.getElementById("myRange").value = Math.floor(boardSize / 10);
   },
        methods: {
     updateSettings: function(event) {