aboutsummaryrefslogtreecommitdiffstats
path: root/src/js/app.js
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2013-08-07 11:41:01 +0100
committerStruan Donald <struan@exo.org.uk>2013-08-07 11:41:01 +0100
commitdf66eb0291e7478c7df9603a28e966fa40f68738 (patch)
tree729139c07dc9fa0164dde3edf475968b7f2561fd /src/js/app.js
parentd418a7de38becda6d892ca62f30792a4416b2218 (diff)
Force saving of draft if removing a photo
Becuase we don't save drafts that are only a location once you remove the photo from a report that only has a location and a photo that change isn't saved as it becomes a report with only a location hence add a force option so saveCurrentDrafts and use it when removing a photo. Fixes #86
Diffstat (limited to 'src/js/app.js')
-rw-r--r--src/js/app.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/js/app.js b/src/js/app.js
index 69edd89..4709ea6 100644
--- a/src/js/app.js
+++ b/src/js/app.js
@@ -90,9 +90,9 @@ var tpl = {
}
},
- saveCurrentDraft: function() {
+ saveCurrentDraft: function(force) {
FMS.router.pause();
- if ( FMS.currentDraft.isPartial() ) {
+ if ( force || FMS.currentDraft.isPartial() ) {
FMS.allDrafts.add( FMS.currentDraft );
FMS.currentDraft.save();
localStorage.currentDraftID = FMS.currentDraft.id;