Skip to content
Snippets Groups Projects
Commit 753da69b authored by Peter Rotich's avatar Peter Rotich
Browse files

Merge pull request #92 from greezybacon/issue/90


Continue drafts after a reset

Reviewed-By: default avatarPeter Rotich <peter@osticket.com>
parents f4d138a7 ecfd5877
No related branches found
No related tags found
No related merge requests found
......@@ -83,6 +83,7 @@ RedactorPlugins.draft = {
self.opts.imageUploadErrorCallback = self.displayError;
}
});
this.opts.original_autosave = this.opts.autosave;
this.opts.autosave = 'ajax.php/draft/'+data.draft_id;
},
......@@ -95,17 +96,18 @@ RedactorPlugins.draft = {
},
deleteDraft: function() {
if (!this.draft_id)
// Nothing to delete
return;
var self = this;
$.ajax('ajax.php/draft/'+this.draft_id, {
type: 'delete',
async: false,
success: function() {
self.opts.autosave = '';
self.opts.imageUpload = '';
self.draft_id = undefined;
clearInterval(self.autosaveInterval);
self.hideDraftSaved();
self.set('');
self.opts.autosave = self.opts.original_autosave;
}
});
},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment