diff options
author | Dave Arter <davea@mysociety.org> | 2017-07-18 19:35:53 +0100 |
---|---|---|
committer | Dave Arter <davea@mysociety.org> | 2018-04-30 13:13:02 +0100 |
commit | 8d8e65fb32b47eeccb3b82ddd1111a8d24856a4d (patch) | |
tree | ec2563a5022ebb9bf51619f305a9a6b7d57e2c14 /www/js/views/submit.js | |
parent | c4dcd37dede1a1736aa391a05c2020815390a79f (diff) |
Add CONFIG.SKIP_CONFIRM_REPORT to skip confirm page if logged in
Diffstat (limited to 'www/js/views/submit.js')
-rw-r--r-- | www/js/views/submit.js | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/www/js/views/submit.js b/www/js/views/submit.js index 6a7c946..edf6dd1 100644 --- a/www/js/views/submit.js +++ b/www/js/views/submit.js @@ -468,12 +468,26 @@ // TODO: this is a temporary measure which should be replaced by a more // sensible login mechanism if ( err.check_name ) { - this.onClickSubmit(); + this.doSubmit(); } else { if ( err.errors && err.errors.password ) { this.validationError('form_password', err.errors.password ); } } + }, + + afterRender: function() { + console.log("SubmitConfirmView.afterRender"); + if (CONFIG.SKIP_CONFIRM_REPORT) { + var that = this; + setTimeout(function() { + // This needs to be in a setTimeout call otherwise + // the app gets stuck on an empty "Your Details" page. + // This is something to do with the way Backbone routes + // between views, I believe. + that.doSubmit(); + }, 10); + } } }) }); |