aboutsummaryrefslogtreecommitdiffstats
path: root/www/js/views/existing.js
diff options
context:
space:
mode:
Diffstat (limited to 'www/js/views/existing.js')
-rw-r--r--www/js/views/existing.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/www/js/views/existing.js b/www/js/views/existing.js
new file mode 100644
index 0000000..b4af574
--- /dev/null
+++ b/www/js/views/existing.js
@@ -0,0 +1,26 @@
+(function (FMS, Backbone, _, $) {
+ _.extend( FMS, {
+ ExistingView: FMS.FMSView.extend({
+ template: 'existing',
+ id: 'existing',
+
+ events: {
+ 'pagehide': 'destroy',
+ 'pageshow': 'afterDisplay',
+ 'click #use_report': 'useReport',
+ 'click #discard': 'discardReport'
+ },
+
+ useReport: function() {
+ localStorage.currentDraftID = FMS.currentDraft.id;
+ this.navigate('around');
+ },
+
+ discardReport: function() {
+ FMS.currentDraft.destroy();
+ FMS.currentDraft = new FMS.Draft();
+ this.navigate('around');
+ }
+ })
+ });
+})(FMS, Backbone, _, $);