diff options
author | Struan Donald <struan@exo.org.uk> | 2013-04-16 15:58:15 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2013-04-16 15:58:15 +0100 |
commit | 6b00ae15e7748b623478e9788e6ffe21eb5407f9 (patch) | |
tree | fb47fd87f4dcc528d689612ba69720f502dd9207 /www/js/app.js | |
parent | 6af73e053fda5f15ca85480b2538ff27d3790ecc (diff) |
move removeDraft functionality to main object and use that elsewhere
Diffstat (limited to 'www/js/app.js')
-rw-r--r-- | www/js/app.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/www/js/app.js b/www/js/app.js index caf7bed..20eceed 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -69,6 +69,22 @@ var tpl = { localStorage.currentDraftID = null; }, + removeDraft: function(draftID, removePhoto) { + console.log( draftID ); + var draft = FMS.allDrafts.get(draftID); + console.log( draft ); + var uri = draft.get('file'); + FMS.allDrafts.remove(draft); + draft.destroy(); + + if ( removePhoto && uri ) { + return FMS.files.deleteURI( uri ); + } + var p = $.Deferred(); + p.resolve(); + return p; + }, + initialize: function () { if ( this.initialized == 1 ) { return this; |