diff options
author | Dave Arter <davea@mysociety.org> | 2018-04-26 21:13:25 +0100 |
---|---|---|
committer | Dave Arter <davea@mysociety.org> | 2018-04-30 13:15:29 +0100 |
commit | 90a0e3b2a9721e8f913da72a65d193dc54f5b74f (patch) | |
tree | f8ceb6ba0b60b261f1c46ce3bda02ef97a0ee59c /www/js | |
parent | 54231a6d7873b8fa2756299d8621f72c36ae32b9 (diff) |
Don’t skip back twice in navigation
On the details extra/certain submit views, clicking the
“Back” button would skip back two screens because the
event wasn’t cancelled, causing the newly-shown “Back”
button to be triggered.
Diffstat (limited to 'www/js')
-rw-r--r-- | www/js/views/details_extra.js | 3 | ||||
-rw-r--r-- | www/js/views/submit.js | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/www/js/views/details_extra.js b/www/js/views/details_extra.js index 160ff11..734a27e 100644 --- a/www/js/views/details_extra.js +++ b/www/js/views/details_extra.js @@ -21,7 +21,8 @@ this.populateFields(); }, - onClickButtonPrev: function() { + onClickButtonPrev: function(e) { + e.preventDefault(); this.model.set('hasExtras', 0); this.updateCurrentReport(); this.navigate( this.prev, true ); diff --git a/www/js/views/submit.js b/www/js/views/submit.js index edf6dd1..ec89928 100644 --- a/www/js/views/submit.js +++ b/www/js/views/submit.js @@ -145,7 +145,8 @@ (function (FMS, Backbone, _, $) { _.extend( FMS, { SubmitInitialPageView: FMS.SubmitView.extend({ - onClickButtonPrev: function() { + onClickButtonPrev: function(e) { + e.preventDefault(); if ( this.model.get('hasExtras') == 1 ) { this.navigate( 'details_extra', true ); } else { |