Finished translations
[vchess.git] / public / javascripts / variant.js
CommitLineData
f5d3e4f5
BA
1new Vue({
2 el: "#variantPage",
c794dbb8 3 data: {
a5d56686 4 display: "play", //default: play!
c794dbb8
BA
5 problem: undefined, //current problem in view
6 },
d449ae46
BA
7 created: function() {
8 const url = window.location.href;
9 const hashPos = url.indexOf("#");
a5d56686 10 console.log(hashPos + " " + url);
d449ae46
BA
11 if (hashPos >= 0)
12 this.setDisplay(url.substr(hashPos+1));
13 },
4ecf423b 14 methods: {
c794dbb8
BA
15 showProblem: function(problemTxt) {
16 this.problem = JSON.parse(problemTxt);
a5d56686 17 this.display = "play";
c794dbb8 18 },
e6dcb115
BA
19 setDisplay: function(elt) {
20 this.display = elt;
a5d56686
BA
21 let menuToggle = document.getElementById("drawer-control");
22 if (!!menuToggle)
23 menuToggle.checked = false;
e6dcb115 24 },
4ecf423b 25 },
f5d3e4f5 26});