From a95deb9f34a79efbe1a682b11d2a2146b82c40b5 Mon Sep 17 00:00:00 2001 From: Struan Donald Date: Fri, 7 Jun 2013 15:18:44 +0100 Subject: 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 --- www/js/models/draft.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'www/js/models/draft.js') 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' ); } -- cgit v1.2.3