aboutsummaryrefslogtreecommitdiffstats
path: root/www/js
diff options
context:
space:
mode:
Diffstat (limited to 'www/js')
-rw-r--r--www/js/views/existing.js14
1 files changed, 13 insertions, 1 deletions
diff --git a/www/js/views/existing.js b/www/js/views/existing.js
index b4af574..1fc88c0 100644
--- a/www/js/views/existing.js
+++ b/www/js/views/existing.js
@@ -17,9 +17,21 @@
},
discardReport: function() {
+ var uri = FMS.currentDraft.get('file');
+ FMS.allDrafts.remove(FMS.currentDraft);
FMS.currentDraft.destroy();
+ localStorage.currentDraftID = null;
FMS.currentDraft = new FMS.Draft();
- this.navigate('around');
+
+ if ( uri ) {
+ var del = FMS.files.deleteURI( uri );
+
+ var that = this;
+ del.done( function() { that.navigate( 'around' ); } );
+
+ } else {
+ this.navigate( 'around', 'left' );
+ }
}
})
});