From 840cdf39595c6b8a29d2c91447d9fb8a91582a59 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Mon, 30 Nov 2015 16:14:29 -0500 Subject: ui changes --- .../ios/www/js/lib/account/ProfileView.js | 57 +++++++--------------- 1 file changed, 18 insertions(+), 39 deletions(-) (limited to 'StoneIsland/platforms/ios/www/js/lib/account/ProfileView.js') diff --git a/StoneIsland/platforms/ios/www/js/lib/account/ProfileView.js b/StoneIsland/platforms/ios/www/js/lib/account/ProfileView.js index 9150f874..999e8d65 100644 --- a/StoneIsland/platforms/ios/www/js/lib/account/ProfileView.js +++ b/StoneIsland/platforms/ios/www/js/lib/account/ProfileView.js @@ -31,24 +31,9 @@ var ProfileView = FormView.extend({ if (data.CurrentPassword && ! data.NewPassword) { errors.push([ "NewPassword", "Please enter your new password." ]) } if (data.NewPassword && data.NewPassword.length < 7) { errors.push([ "CurrentPassword", "New password must be 7 characters or more." ]) } if (data.Gender === "NONE") { errors.push([ "Gender", "Please supply your gender." ]) } - - data.BirthDay += "T00:00:00Z" - data.YooxLetter = data.YooxLetter || "false" }, - save: function(e){ - e && e.preventDefault() - - var valid = this.validate() - if (valid.errors.length) { - this.show_errors(valid.errors) - return - } - else { - this.hide_errors() - } - - var data = valid.data + finalize: function(data){ if (data.CurrentPassword && (data.NewPassword || data.Email !== auth.user.Email)) { data.NewPassword = data.NewPassword || data.CurrentPassword data.NewEmail = data.NewEmail || auth.user.Email @@ -65,30 +50,20 @@ var ProfileView = FormView.extend({ }) } - var submissible_data = _.pick(valid.data, "Name Surname BirthDay Gender YooxLetter".split(" ")) - - submissible_data.idUser = auth.user_id - submissible_data.AccessToken = auth.access_token - submissible_data.Premium = "false" - submissible_data.LanguageId = "" - submissible_data.SiteCode = "STONEISLAND_US" - submissible_data.FuriganaName = "" - submissible_data.FuriganaSurname = "" - submissible_data.UserPromocode = "" + var submissible_data = _.pick(data, "Name Surname BirthDay Gender YooxLetter".split(" ")) +// submissible_data.idUser = auth.user_id +// submissible_data.AccessToken = auth.access_token +// submissible_data.Premium = "false" +// submissible_data.LanguageId = "" +// submissible_data.SiteCode = "STONEISLAND_US" +// submissible_data.FuriganaName = "" +// submissible_data.FuriganaSurname = "" +// submissible_data.UserPromocode = "" + submissible_data.BirthDay += "T00:00:00Z" + submissible_data.YooxLetter = data.YooxLetter || "false" submissible_data.DataProfiling = "true" - - app.curtain.show("loading") - sdk.account.update({ - data: submissible_data, - success: function(data){ - app.curtain.hide("loading") - this.success(data) - }.bind(this), - error: function(data){ - app.curtain.hide("loading") - this.error(data) - }.bind(this), - }) + + return submissible_data }, success: function(data){ @@ -96,5 +71,9 @@ var ProfileView = FormView.extend({ error: function(data){ }, + + cancel: function(){ + app.router.go("intro") + }, }) \ No newline at end of file -- cgit v1.2.3-70-g09d2