X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=public%2Fjavascripts%2Fvariant.js;fp=public%2Fjavascripts%2Fvariant.js;h=f77be32992db56f0f3c9c020273c9c9660cb1398;hp=f9fb0c62dd5aa3796de21b34ec687c6a2c3caa16;hb=d449ae46d69980f18c96dbd5a87135d257dcb19d;hpb=73564bf6340694c2e8a67a7c57334da5c1c23a73 diff --git a/public/javascripts/variant.js b/public/javascripts/variant.js index f9fb0c62..f77be329 100644 --- 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 }, + 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);