|
@@ -19,7 +19,7 @@ function log() {
|
|
var app = new Vue({
|
|
var app = new Vue({
|
|
el: '#app',
|
|
el: '#app',
|
|
data: {
|
|
data: {
|
|
- title: "GUNTRADER",
|
|
|
|
|
|
+ title: "guntrader",
|
|
queries: {},
|
|
queries: {},
|
|
debug: false,
|
|
debug: false,
|
|
account: false,
|
|
account: false,
|
|
@@ -36,13 +36,18 @@ var app = new Vue({
|
|
|
|
|
|
mounted: function () {
|
|
mounted: function () {
|
|
// hide splash
|
|
// hide splash
|
|
|
|
+ var self = this;
|
|
var splash = document.getElementById("splash");
|
|
var splash = document.getElementById("splash");
|
|
splash.style.display = "none";
|
|
splash.style.display = "none";
|
|
// unhide main container after mount
|
|
// unhide main container after mount
|
|
this.$el.style.display = "block";
|
|
this.$el.style.display = "block";
|
|
- this.account = window.location.hash.slice(1)
|
|
|
|
- // get_items();
|
|
|
|
- this.load_account();
|
|
|
|
|
|
+
|
|
|
|
+ this.update();
|
|
|
|
+
|
|
|
|
+ window.addEventListener('hashchange', function() {
|
|
|
|
+ self.update()
|
|
|
|
+
|
|
|
|
+ }, false);
|
|
|
|
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
@@ -67,6 +72,16 @@ var app = new Vue({
|
|
},
|
|
},
|
|
|
|
|
|
methods: {
|
|
methods: {
|
|
|
|
+ update: function () {
|
|
|
|
+ this.account = window.location.hash.slice(1)
|
|
|
|
+ if (this.account) {
|
|
|
|
+ console.log(this.account);
|
|
|
|
+ this.load_account();
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ },
|
|
load_account: function () {
|
|
load_account: function () {
|
|
var self = this;
|
|
var self = this;
|
|
fetch('load/' + self.account)
|
|
fetch('load/' + self.account)
|