projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Draft code reorganisation (+ fix Alice rules + stateless VariantRules object)
[vchess.git]
/
public
/
javascripts
/
variant.js
diff --git
a/public/javascripts/variant.js
b/public/javascripts/variant.js
index
d617c60
..
ae576d8
100644
(file)
--- a/
public/javascripts/variant.js
+++ b/
public/javascripts/variant.js
@@
-1,26
+1,25
@@
new Vue({
el: "#variantPage",
data: {
new Vue({
el: "#variantPage",
data: {
- display: "play", //default: play!
- problem: undefined, //current problem in view
+ display: "room", //default: main hall
},
created: function() {
},
created: function() {
+ // TODO: navigation becomes a little more complex
const url = window.location.href;
const hashPos = url.indexOf("#");
const url = window.location.href;
const hashPos = url.indexOf("#");
- console.log(hashPos + " " + url);
if (hashPos >= 0)
this.setDisplay(url.substr(hashPos+1));
},
methods: {
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;
setDisplay: function(elt) {
this.display = elt;
+ // Close menu on small screens:
let menuToggle = document.getElementById("drawer-control");
if (!!menuToggle)
menuToggle.checked = false;
},
},
});
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 !