diff options
author | Struan Donald <struan@exo.org.uk> | 2014-10-03 15:07:08 +0100 |
---|---|---|
committer | Dave Arter <davea@mysociety.org> | 2015-08-28 14:27:15 +0100 |
commit | a69d425c0e5c004145ac1ab70e2f7f9fc329b54c (patch) | |
tree | 8eb7ff0ff7aaa0fce8bc7214ec6e15b694fddbdc /www/js/views/save_offline.js | |
parent | 8fd15b58733c51d7f001f9eac66b7d03830ec0b4 (diff) |
update Android to Cordova 3.6
Required due to security issue
Remove Android directory as no longer required, move src -> www to match
standard layout, update .gitignore to avoid including the standard
platform files, update README based on Steve's zurich one
Diffstat (limited to 'www/js/views/save_offline.js')
-rw-r--r-- | www/js/views/save_offline.js | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/www/js/views/save_offline.js b/www/js/views/save_offline.js new file mode 100644 index 0000000..d00170c --- /dev/null +++ b/www/js/views/save_offline.js @@ -0,0 +1,32 @@ +(function (FMS, Backbone, _, $) { + _.extend( FMS, { + SaveOfflineView: FMS.FMSView.extend({ + template: 'save_offline', + id: 'save_offline', + + events: { + 'pagehide': 'destroy', + 'pagebeforeshow': 'beforeDisplay', + 'pageshow': 'afterDisplay', + 'vclick #save_report': 'saveReport', + 'vclick #discard': 'discardReport' + }, + + saveReport: function() { + FMS.clearCurrentDraft(); + this.navigate('reports'); + }, + + discardReport: function() { + var reset = FMS.removeDraft(FMS.currentDraft.id, true); + var that = this; + reset.done( function() { that.onDraftRemove(); } ); + reset.fail( function() { that.onDraftRemove(); } ); + }, + + onDraftRemove: function() { + this.navigate( 'around', 'left' ); + } + }) + }); +})(FMS, Backbone, _, $); |