diff options
author | Jedidiah Broadbent <hello@jedidiah.eu> | 2013-06-10 10:09:18 +0100 |
---|---|---|
committer | Jedidiah Broadbent <hello@jedidiah.eu> | 2013-06-10 10:09:18 +0100 |
commit | 304ef3db5e4f28003003da0636110b4d893e8baa (patch) | |
tree | 15d85bc8a9cb8ec94358cfa5a665c5ff744c76fc /www/js/views/submit.js | |
parent | fb5fefe53acea54e742b19f9f7f0a6bf80b89ace (diff) | |
parent | 8aad0ec269d35a46d7ee01b36ce68c54b81f9de3 (diff) |
Merge branch 'phonegap-jquery-mobile-new' of ssh://git.mysociety.org/data/git/public/fixmystreet into phonegap-jquery-mobile-new
Diffstat (limited to 'www/js/views/submit.js')
-rw-r--r-- | www/js/views/submit.js | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/www/js/views/submit.js b/www/js/views/submit.js index bab9396..e408a2e 100644 --- a/www/js/views/submit.js +++ b/www/js/views/submit.js @@ -55,6 +55,12 @@ if ( FMS.currentUser ) { FMS.currentUser.save(); } + if (resp.report) { + this.report.set('site_id', resp.report); + this.report.set('site_url', CONFIG.FMS_URL + '/report/' + resp.report); + } else { + this.report.set('email_confirm', 1); + } var reset = FMS.removeDraft( model.id, true); var that = this; reset.done( function() { that.onRemoveDraft(); } ); @@ -115,14 +121,16 @@ return isValid; }, - onClickPassword: function() { + onClickPassword: function(e) { + e.preventDefault(); if ( this.validate() ) { FMS.currentUser.set('email', $('#form_email').val()); this.navigate( 'submit-password' ); } }, - onClickConfirm: function() { + onClickConfirm: function(e) { + e.preventDefault(); if ( this.validate() ) { FMS.currentUser.set('email', $('#form_email').val()); this.navigate( 'submit-name' ); @@ -180,7 +188,7 @@ this.model.set('submit_clicked', 'submit_register'); FMS.currentUser.set('name', $('#form_name').val()); FMS.currentUser.set('phone', $('#form_phone').val()); - this.navigate( 'submit-password' ); + this.navigate( 'submit-set-password' ); } }, @@ -265,6 +273,16 @@ (function (FMS, Backbone, _, $) { _.extend( FMS, { + SubmitSetPasswordView: FMS.SubmitPasswordView.extend({ + template: 'submit_password', + id: 'submit--set-password-page', + prev: 'submit-name' + }) + }); +})(FMS, Backbone, _, $); + +(function (FMS, Backbone, _, $) { + _.extend( FMS, { SubmitConfirmView: FMS.SubmitView.extend({ template: 'submit_confirm', id: 'submit-confirm-page', |