Improve style, implement 'next' for corr games. TODO: rematch logic
[vchess.git] / client / src / views / Problems.vue
index 2d6ac69..a1c3e83 100644 (file)
@@ -2,7 +2,7 @@
 main
   input#modalNewprob.modal(
     type="checkbox"
-    @change="infoMsg=''"
+    @change="fenFocusIfOpened($event)"
   )
   div#newprobDiv(
     role="dialog"
@@ -56,7 +56,7 @@ main
         button.nomargin(@click="gotoPrevNext($event,curproblem,1)")
           | {{ st.tr["Previous"] }}
         button.nomargin(@click="gotoPrevNext($event,curproblem,-1)")
-          | {{ st.tr["Next"] }}
+          | {{ st.tr["Next_p"] }}
       p.oneInstructions.clickable(
         v-html="parseHtml(curproblem.instruction)"
         @click="curproblem.showSolution=!curproblem.showSolution"
@@ -193,6 +193,12 @@ export default {
     }
   },
   methods: {
+    fenFocusIfOpened: function(event) {
+      if (event.target.checked) {
+        this.infoMsg = "";
+        document.getElementById("inputFen").focus();
+      }
+    },
     setVname: function(prob) {
       prob.vname = this.st.variants.find(v => v.id == prob.vid).name;
     },