diff options
Diffstat (limited to 'StoneIsland/www/js')
| -rwxr-xr-x | StoneIsland/www/js/lib/_router.js | 15 | ||||
| -rw-r--r-- | StoneIsland/www/js/lib/account/ConsentModal.js | 6 |
2 files changed, 15 insertions, 6 deletions
diff --git a/StoneIsland/www/js/lib/_router.js b/StoneIsland/www/js/lib/_router.js index 723bb944..1d9010ff 100755 --- a/StoneIsland/www/js/lib/_router.js +++ b/StoneIsland/www/js/lib/_router.js @@ -42,12 +42,12 @@ var SiteRouter = Router.extend({ initialize: function(){ var fn - for (var route in this.routes) { - fn = this.routes[route] - if (! this[fn]) { - this[fn] = this.default_view(fn) - } - } + for (var route in this.routes) { + fn = this.routes[route] + if (! this[fn]) { + this[fn] = this.default_view(fn) + } + } }, initial_route: null, @@ -75,6 +75,9 @@ var SiteRouter = Router.extend({ default_view: function(name){ var fn = function(){ console.log(name) + if (app.demand_consent && app.account.consent.check()) { + return + } if (app.view != app.login && app.view != app.signin) { app.last_view = app.view } diff --git a/StoneIsland/www/js/lib/account/ConsentModal.js b/StoneIsland/www/js/lib/account/ConsentModal.js index c4fe0b53..22f63c53 100644 --- a/StoneIsland/www/js/lib/account/ConsentModal.js +++ b/StoneIsland/www/js/lib/account/ConsentModal.js @@ -19,12 +19,16 @@ var ConsentModal = View.extend({ var status = localStorage.getItem('account_terms.consent') if (status !== 'true') { this.show() + return true } else { this.hide() + app.demand_consent = false + return false } }, show: function(){ + app.demand_consent = true this.$el.show() setTimeout(function(){ this.$el.addClass('visible') @@ -63,11 +67,13 @@ var ConsentModal = View.extend({ if (!state) { return } + app.demand_consent = false this.hide() localStorage.setItem('account_terms.consent', 'true') }, logout: function(){ + app.demand_consent = false this.hide() localStorage.setItem('account_terms.consent', 'false') app.router.go("account/logout") |
