diff options
Diffstat (limited to 'StoneIsland/platforms/ios/www/js/lib/_router.js')
| -rwxr-xr-x | StoneIsland/platforms/ios/www/js/lib/_router.js | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/StoneIsland/platforms/ios/www/js/lib/_router.js b/StoneIsland/platforms/ios/www/js/lib/_router.js index bd13c126..91f29b55 100755 --- a/StoneIsland/platforms/ios/www/js/lib/_router.js +++ b/StoneIsland/platforms/ios/www/js/lib/_router.js @@ -39,7 +39,9 @@ var SiteRouter = Router.extend({ '/cart/thanks': 'cart.thanks', '/cart/error': 'cart.error', }, - + + terms_routes: ['terms','account_terms','privacy','returns','care','logout'], + initialize: function(){ var fn for (var route in this.routes) { @@ -75,9 +77,7 @@ var SiteRouter = Router.extend({ default_view: function(name){ var fn = function(){ console.log(name) - if (app.demand_consent && app.consent.check()) { - return - } + var n = [name] if (app.view != app.login && app.view != app.signin) { app.last_view = app.view } @@ -85,7 +85,7 @@ var SiteRouter = Router.extend({ app.view.hide() } if (name.match(/\./)) { - var n = name.split(".") + n = name.split(".") console.log(name, n) app.view = app[n[0]][n[1]] } @@ -97,6 +97,19 @@ var SiteRouter = Router.extend({ console.log("view >>", app.view) app.header.set_back( !! app.view.back ) app.view.show() + + // var isTermsRoute = this.terms_routes.indexOf(name) !== -1 + // var isCartRoute = n[0] === 'cart' + // if ( (isCartRoute || app.demand_consent && !isTermsRoute) && app.account.consent.check()) { + // console.log('showed consent modal') + // return + // } + + var isTermsRoute = this.terms_routes.indexOf(name) !== -1 + if (app.demand_consent && !isTermsRoute && app.account.consent.check()) { + console.log('showed consent modal') + return + } }.bind(this) return fn }, |
