*/
setupAutosave: function() {
var draftid = -1,
+ form,
optiontype = null,
options = this.get('filepickeroptions'),
params,
Y.later(delay, this, this.saveDraft, false, true);
// Now setup the listener for form submission.
- this.textarea.ancestor('form').on('submit', this.resetAutosave, this);
+ form = this.textarea.ancestor('form');
+ if (form) {
+ form.on('submit', this.resetAutosave, this);
+ }
return this;
},