X-Git-Url: https://git.auder.net/img/rock_paper_scissors_lizard_spock.gif?a=blobdiff_plain;f=public%2Fjavascripts%2Fvariant.js;h=f074baeb50745587bbec0926bf42e717f2b2f30d;hb=7d9e99bc177972c5af8b1b45f4bfb043d8306f30;hp=e24dfc688433da348a93d5ccf1e245a3300599bb;hpb=d44df0b01732d1948525daef5df62211ea6e1f64;p=vchess.git diff --git a/public/javascripts/variant.js b/public/javascripts/variant.js index e24dfc68..f074baeb 100644 --- a/public/javascripts/variant.js +++ b/public/javascripts/variant.js @@ -12,13 +12,13 @@ new Vue({ userColor: "w", allowChat: false, - allowMovelist: false, + allowMovelist: true, fen: V.GenRandInitFen(), }, created: function() { // TODO: navigation becomes a little more complex this.setDisplay(); - + window.onhashchange = this.setDisplay; this.myid = "abcdefghij"; //console.log(this.myid + " " + variant); @@ -29,7 +29,6 @@ new Vue({ } this.conn.onclose = socketCloseListener; - window.onhashchange = this.setDisplay; //this.vr = new VariantRules( V.GenRandInitFen() ); }, methods: { @@ -37,8 +36,9 @@ new Vue({ //TODO: prevent set display if there is a running game - const page = (location.hash || "#room").substr(1); - this.display = page; + if (!location.hash) + location.hash = "#room"; //default + this.display = location.hash.substr(1); // Close menu on small screens: let menuToggle = document.getElementById("drawer-control"); if (!!menuToggle)