aboutsummaryrefslogtreecommitdiffstats
path: root/www/js/views
diff options
context:
space:
mode:
Diffstat (limited to 'www/js/views')
-rw-r--r--www/js/views/existing.js7
-rw-r--r--www/js/views/offline.js6
-rw-r--r--www/js/views/submit.js3
3 files changed, 6 insertions, 10 deletions
diff --git a/www/js/views/existing.js b/www/js/views/existing.js
index 95beee5..c9bf459 100644
--- a/www/js/views/existing.js
+++ b/www/js/views/existing.js
@@ -13,18 +13,17 @@
},
useReport: function() {
- localStorage.currentDraftID = FMS.currentDraft.id;
+ FMS.setCurrentDraft(this.model);
this.navigate('around');
},
saveReport: function() {
- localStorage.currentDraftID = null;
- FMS.currentDraft = new FMS.Draft();
+ FMS.clearCurrentDraft();
this.navigate('around');
},
discardReport: function() {
- var reset = FMS.removeDraft(FMS.currentDraft.id, true);
+ var reset = FMS.removeDraft(this.model.id, true);
var that = this;
reset.done( function() { that.onDraftRemove(); } );
},
diff --git a/www/js/views/offline.js b/www/js/views/offline.js
index 8f963f6..342ee1a 100644
--- a/www/js/views/offline.js
+++ b/www/js/views/offline.js
@@ -113,15 +113,13 @@
var that = this;
del.done( function() { that.draftDeleted(); } );
} else {
- localStorage.currentDraftID = null;
- localStorage.currentDraft = new FMS.Draft();
+ FMS.clearCurrentDraft();
this.navigate( this.next, 'left' );
}
},
draftDeleted: function() {
- localStorage.currentDraftID = null;
- localStorage.currentDraft = new FMS.Draft();
+ FMS.clearCurrentDraft();
this.navigate( this.next, 'left' );
},
diff --git a/www/js/views/submit.js b/www/js/views/submit.js
index 4878d7e..937eaa7 100644
--- a/www/js/views/submit.js
+++ b/www/js/views/submit.js
@@ -57,8 +57,7 @@
},
onRemoveDraft: function() {
- FMS.currentDraft = new FMS.Draft();
- localStorage.currentDraftID = null;
+ FMS.clearCurrentDraft();
FMS.createdReport = this.report;
this.navigate( 'sent', 'left' );
},