Finished problems implementation. TODO: specify state for Crazyhouse,Grand. Improve...
[vchess.git] / public / javascripts / variant.js
CommitLineData
f5d3e4f5
BA
1new Vue({
2 el: "#variantPage",
c794dbb8
BA
3 data: {
4 display: "", //do not show anything...
5 problem: undefined, //current problem in view
6 },
4ecf423b
BA
7 methods: {
8 toggleDisplay: function(elt) {
9 if (this.display == elt)
10 this.display = ""; //hide
11 else
12 this.display = elt; //show
13 },
c794dbb8
BA
14 showProblem: function(problemTxt) {
15 this.problem = JSON.parse(problemTxt);
16 this.display = "game";
17 },
4ecf423b 18 },
f5d3e4f5 19});