Merge branch 'MDL-65450-master' of https://github.com/ryanwyllie/moodle

This commit is contained in:
Jun Pataleta 2019-05-03 11:23:18 +08:00
commit 70c1f17d7b

View File

@ -68,9 +68,11 @@ M.editor_tinymce.init_editor = function(Y, editorid, options) {
});
Y.use('event', 'moodle-core-event', function(Y) {
var form = Y.one(document.getElementById(editor.id)).ancestor('form');
form.on(M.core.event.FORM_SUBMIT_AJAX, function() {
editor.save();
}, this)
if (form) {
form.on(M.core.event.FORM_SUBMIT_AJAX, function() {
editor.save();
}, this);
}
});
};