X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=public%2Fjavascripts%2Fcomponents%2Fproblems.js;fp=public%2Fjavascripts%2Fcomponents%2Fproblems.js;h=60aa9c430833caa145aa522d7060a9e6e3a9d91b;hb=a9f262f38d7ae9ea4c935c549309bd2f773aa6c2;hp=558f0bada06f9099d41ed895d76882c05c9561bd;hpb=26b8e4f7c71030d49e44fe1d89632ef91b886d67;p=vchess.git 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) {