X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=public%2Fjavascripts%2Fcomponents%2Fproblems.js;h=d9265a36fcecb7a4df65d24d88f18d7bcef6f6f8;hb=e6dcb115eab52abefa1d54a65af546cf5a0153e9;hp=3bd13f63baf8856259deca647cfece614feaef7f;hpb=45109880413a50dec3a07298b987fb07d60630b2;p=vchess.git diff --git a/public/javascripts/components/problems.js b/public/javascripts/components/problems.js index 3bd13f63..d9265a36 100644 --- a/public/javascripts/components/problems.js +++ b/public/javascripts/components/problems.js @@ -3,7 +3,7 @@ Vue.component('my-problems', { return { problems: problemArray, //initial value newProblem: { - fen: V.GenRandInitFen(), + fen: "", instructions: "", solution: "", stage: "nothing", //or "preview" after new problem is filled @@ -16,7 +16,8 @@ Vue.component('my-problems', { + v-for="(p,idx) in sortedProblems" + v-bind:prob="p" v-bind:preview="false" v-bind:key="idx">
@@ -26,24 +27,29 @@ Vue.component('my-problems', {
- +

Safe HTML tags allowed

- // TODO: we don't want exactly the same display (-date +solution) - - + + + +
+ + +
@@ -99,6 +105,8 @@ Vue.component('my-problems', { instructions: this.newProblem.instructions, solution: this.newProblem.solution, }, response => { + this.newProblem.added = Date.now(); + this.problems.push(JSON.parse(JSON.stringify(this.newProblem))); document.getElementById("modal-newproblem").checked = false; this.newProblem.stage = "nothing"; });