diff options
Diffstat (limited to 'StoneIsland/www/js/lib/account')
| -rwxr-xr-x | StoneIsland/www/js/lib/account/AccountView.js | 18 | ||||
| -rwxr-xr-x | StoneIsland/www/js/lib/account/ProfileView.js | 21 |
2 files changed, 31 insertions, 8 deletions
diff --git a/StoneIsland/www/js/lib/account/AccountView.js b/StoneIsland/www/js/lib/account/AccountView.js index 1c5c9f16..7d3b719a 100755 --- a/StoneIsland/www/js/lib/account/AccountView.js +++ b/StoneIsland/www/js/lib/account/AccountView.js @@ -99,12 +99,18 @@ var AccountView = View.extend({ if ( ! auth.has_cart() ) { app.curtain.show("loading") auth.create_cart(function(){ - auth.add_deferred_product_to_cart(function(){ - app.router.go("cart") - setTimeout(function(){ - app.curtain.hide("loading") - }, 500) - }) + if (auth.deferred_product) { + auth.add_deferred_product_to_cart(function(){ + app.router.go("cart") + setTimeout(function(){ + app.curtain.hide("loading") + }, 500) + }) + } + else { + app.router.go("account/profile") + app.curtain.hide("loading") + } }) } else { diff --git a/StoneIsland/www/js/lib/account/ProfileView.js b/StoneIsland/www/js/lib/account/ProfileView.js index f370c055..2b608cb4 100755 --- a/StoneIsland/www/js/lib/account/ProfileView.js +++ b/StoneIsland/www/js/lib/account/ProfileView.js @@ -17,6 +17,20 @@ var ProfileView = FormView.extend({ if (! auth.logged_in()) { return app.router.go("intro") } app.footer.show("SAVE") document.body.className = "profile" + auth.user.DataProfiling2 = auth.user.DataProfiling + if (auth.user.BirthDay.match(/T/)) { + auth.user.BirthDay = auth.user.BirthDay.split("T")[0] + } + if (auth.user.name && ! auth.user.Name) { + auth.user.Name = auth.user.name + } + if (auth.user.surname && ! auth.user.Surname) { + auth.user.Surname = auth.user.surname + } + if (auth.user.email && ! auth.user.Email) { + auth.user.Email = auth.user.email + } + console.log(auth.user) this.preload(auth.user) this.deferScrollToTop() }, @@ -63,8 +77,11 @@ var ProfileView = FormView.extend({ // submissible_data.FuriganaSurname = "" // submissible_data.UserPromocode = "" submissible_data.BirthDay += "T00:00:00Z" - submissible_data.YooxLetter = data.YooxLetter || "false" - submissible_data.DataProfiling = "true" + submissible_data.YooxLetter = this.$("[name=YooxLetter]").prop("checked") + submissible_data.DataProfiling = this.$("[name=DataProfiling]").prop("checked") + + console.log(data.DataProfiling, submissible_data.DataProfiling) + console.log(submissible_data) return submissible_data }, |
