Play computer move in webworker to not freeze interface
[vchess.git] / public / javascripts / variant.js
CommitLineData
f5d3e4f5
BA
1new Vue({
2 el: "#variantPage",
c794dbb8 3 data: {
643479f8 4 display: getCookie("display-"+variant,""), //default: do not show anything...
c794dbb8
BA
5 problem: undefined, //current problem in view
6 },
4ecf423b
BA
7 methods: {
8 toggleDisplay: function(elt) {
9 if (this.display == elt)
643479f8 10 {
4ecf423b 11 this.display = ""; //hide
643479f8
BA
12 setCookie("display-"+variant, "");
13 }
4ecf423b 14 else
643479f8 15 {
4ecf423b 16 this.display = elt; //show
643479f8
BA
17 setCookie("display-"+variant, elt);
18 }
4ecf423b 19 },
c794dbb8
BA
20 showProblem: function(problemTxt) {
21 this.problem = JSON.parse(problemTxt);
22 this.display = "game";
23 },
4ecf423b 24 },
f5d3e4f5 25});