mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 08:22:07 +02:00
MDL-49256 atto: Check form existence before resetAutosave
This commit is contained in:
parent
b90f98dade
commit
c4e2c67134
@ -828,6 +828,7 @@ EditorAutosave.prototype = {
|
||||
*/
|
||||
setupAutosave: function() {
|
||||
var draftid = -1,
|
||||
form,
|
||||
optiontype = null,
|
||||
options = this.get('filepickeroptions'),
|
||||
params,
|
||||
@ -906,7 +907,10 @@ EditorAutosave.prototype = {
|
||||
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;
|
||||
},
|
||||
|
||||
|
File diff suppressed because one or more lines are too long
@ -823,6 +823,7 @@ EditorAutosave.prototype = {
|
||||
*/
|
||||
setupAutosave: function() {
|
||||
var draftid = -1,
|
||||
form,
|
||||
optiontype = null,
|
||||
options = this.get('filepickeroptions'),
|
||||
params,
|
||||
@ -899,7 +900,10 @@ EditorAutosave.prototype = {
|
||||
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;
|
||||
},
|
||||
|
||||
|
@ -107,6 +107,7 @@ EditorAutosave.prototype = {
|
||||
*/
|
||||
setupAutosave: function() {
|
||||
var draftid = -1,
|
||||
form,
|
||||
optiontype = null,
|
||||
options = this.get('filepickeroptions'),
|
||||
params,
|
||||
@ -185,7 +186,10 @@ EditorAutosave.prototype = {
|
||||
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;
|
||||
},
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user