X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=public%2Fjavascripts%2Fvariant.js;h=736d8b3dbfded55cb1eca5e7efa5c1aad338651a;hb=298c42e63ae321526693e9ce418c4113af36e025;hp=d617c60affa4add018b9f1baf29dddf74ac55702;hpb=a5d5668613d9a3d04c9a4f8b69122d02b7322137;p=vchess.git diff --git a/public/javascripts/variant.js b/public/javascripts/variant.js index d617c60a..736d8b3d 100644 --- a/public/javascripts/variant.js +++ b/public/javascripts/variant.js @@ -1,26 +1,26 @@ new Vue({ el: "#variantPage", data: { - display: "play", //default: play! - problem: undefined, //current problem in view + display: "room", //default: main hall + gameid: "undefined", //...yet }, created: function() { + // TODO: navigation becomes a little more complex const url = window.location.href; const hashPos = url.indexOf("#"); - console.log(hashPos + " " + url); if (hashPos >= 0) this.setDisplay(url.substr(hashPos+1)); }, methods: { - showProblem: function(problemTxt) { - this.problem = JSON.parse(problemTxt); - this.display = "play"; - }, setDisplay: function(elt) { this.display = elt; + // Close menu on small screens: let menuToggle = document.getElementById("drawer-control"); if (!!menuToggle) menuToggle.checked = false; }, }, }); + +// TODO: +// si quand on arrive il y a une continuation "humaine" : display="game" et retour à la partie !