From a9f262f38d7ae9ea4c935c549309bd2f773aa6c2 Mon Sep 17 00:00:00 2001 From: Benjamin Auder Date: Wed, 9 Jan 2019 18:51:38 +0100 Subject: [PATCH] Small update of problems component --- public/javascripts/components/problems.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/public/javascripts/components/problems.js b/public/javascripts/components/problems.js index 558f0bad..60aa9c43 100644 --- a/public/javascripts/components/problems.js +++ b/public/javascripts/components/problems.js @@ -3,12 +3,13 @@ Vue.component('my-problems', { return { problems: [], //oldest first myProblems: [], //same - curIdx: 0, //index in problems array - stage: "nothing", //or "preview" after new problem is filled + curProblems: [], //assigned to either of the ones above + curIdx: 0, //index in (current) problems array newProblem: { fen: "", instructions: "", solution: "", + preview: false, }, }; }, @@ -28,7 +29,8 @@ Vue.component('my-problems', { skip_next - + --> OK, mais ces flèches n'ont pas la même action selon les vues + --> fetchN si liste, problème suivant/précédent sinon board qui bouge et activé que si #hash donnant numéro du problème @@ -142,6 +144,7 @@ if (this.mode == "problem") // Analyse URL: if a single problem required, show it. Otherwise, // TODO: fetch most recent problems from server // If the requested problem is in the list, just show it + this.tryNavigate(); }, methods: { translate: function(text) { -- 2.44.0