From: Benjamin Auder Date: Wed, 9 Jan 2019 17:51:38 +0000 (+0100) Subject: Small update of problems component X-Git-Url: https://git.auder.net/img/bundles/framework/css/js/DESCRIPTION?a=commitdiff_plain;h=a9f262f38d7ae9ea4c935c549309bd2f773aa6c2;p=vchess.git Small update of problems component --- 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) {