aboutsummaryrefslogtreecommitdiffstats
path: root/www/js/models/draft.js
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2013-06-07 15:18:44 +0100
committerStruan Donald <struan@exo.org.uk>2013-06-07 15:33:49 +0100
commita95deb9f34a79efbe1a682b11d2a2146b82c40b5 (patch)
tree9f00391683ff65d9268aae411091e9038eeabe30 /www/js/models/draft.js
parentb2ce0c4a328de1919b948683170baac7565a4a9e (diff)
More explicable behaviour when you click cancel on the map screen
If the report only has location details then just throw them away, otherwise leave the report as a draft and then create a new draft
Diffstat (limited to 'www/js/models/draft.js')
-rw-r--r--www/js/models/draft.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/www/js/models/draft.js b/www/js/models/draft.js
index b033f21..97a92ff 100644
--- a/www/js/models/draft.js
+++ b/www/js/models/draft.js
@@ -28,6 +28,19 @@
return desc;
},
+ isPartial: function() {
+ if (
+ this.get('title') ||
+ this.get('details') ||
+ this.get('category') ||
+ this.get('file')
+ ) {
+ return true;
+ }
+
+ return false;
+ },
+
createdDate: function() {
return moment.utc( this.get('created') ).format( 'H:mm Do MMM' );
}