projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Simplify navigation
[vchess.git]
/
public
/
javascripts
/
variant.js
diff --git
a/public/javascripts/variant.js
b/public/javascripts/variant.js
index
e24dfc6
..
74c4298
100644
(file)
--- a/
public/javascripts/variant.js
+++ b/
public/javascripts/variant.js
@@
-18,7
+18,7
@@
new Vue({
created: function() {
// TODO: navigation becomes a little more complex
this.setDisplay();
created: function() {
// TODO: navigation becomes a little more complex
this.setDisplay();
-
+ window.onhashchange = this.setDisplay;
this.myid = "abcdefghij";
//console.log(this.myid + " " + variant);
this.myid = "abcdefghij";
//console.log(this.myid + " " + variant);
@@
-29,7
+29,6
@@
new Vue({
}
this.conn.onclose = socketCloseListener;
}
this.conn.onclose = socketCloseListener;
- window.onhashchange = this.setDisplay;
//this.vr = new VariantRules( V.GenRandInitFen() );
},
methods: {
//this.vr = new VariantRules( V.GenRandInitFen() );
},
methods: {
@@
-37,8
+36,9
@@
new Vue({
//TODO: prevent set display if there is a running game
//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)
// Close menu on small screens:
let menuToggle = document.getElementById("drawer-control");
if (!!menuToggle)