diff options
Diffstat (limited to 'www/js/views/existing.js')
-rw-r--r-- | www/js/views/existing.js | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/www/js/views/existing.js b/www/js/views/existing.js index 1fc88c0..4abf857 100644 --- a/www/js/views/existing.js +++ b/www/js/views/existing.js @@ -17,21 +17,13 @@ }, discardReport: function() { - var uri = FMS.currentDraft.get('file'); - FMS.allDrafts.remove(FMS.currentDraft); - FMS.currentDraft.destroy(); - localStorage.currentDraftID = null; - FMS.currentDraft = new FMS.Draft(); - - if ( uri ) { - var del = FMS.files.deleteURI( uri ); - - var that = this; - del.done( function() { that.navigate( 'around' ); } ); + var reset = FMS.removeDraft(FMS.currentDraft.id, true); + var that = this; + reset.done( function() { that.onDraftRemove(); } ); + }, - } else { - this.navigate( 'around', 'left' ); - } + onDraftRemove: function() { + this.navigate( 'around', 'left' ); } }) }); |