projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Improve style on variant page; TODO: problems, Crazyhouse
[vchess.git]
/
public
/
javascripts
/
variant.js
diff --git
a/public/javascripts/variant.js
b/public/javascripts/variant.js
index
f9fb0c6
..
f77be32
100644
(file)
--- a/
public/javascripts/variant.js
+++ b/
public/javascripts/variant.js
@@
-4,6
+4,12
@@
new Vue({
display: "game", //default: play!
problem: undefined, //current problem in view
},
display: "game", //default: play!
problem: undefined, //current problem in view
},
+ created: function() {
+ const url = window.location.href;
+ const hashPos = url.indexOf("#");
+ if (hashPos >= 0)
+ this.setDisplay(url.substr(hashPos+1));
+ },
methods: {
showProblem: function(problemTxt) {
this.problem = JSON.parse(problemTxt);
methods: {
showProblem: function(problemTxt) {
this.problem = JSON.parse(problemTxt);