Skip to content

Commit

Permalink
Merge branch 'MDL-75782-400' of https://github.com/andrewnicols/moodle
Browse files Browse the repository at this point in the history
…into MOODLE_400_STABLE
  • Loading branch information
junpataleta committed Sep 29, 2022
2 parents 5ce0f28 + 493ef64 commit 643d5ec
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 4 deletions.
Expand Up @@ -267,7 +267,14 @@ M.mod_quiz.autosave = {

Y.log('Found TinyMCE.', 'debug', 'moodle-mod_quiz-autosave');
this.editor_change_handler = Y.bind(this.editor_changed, this);
window.tinyMCE.onAddEditor.add(Y.bind(this.init_tinymce_editor, this));
if (window.tinyMCE.onAddEditor) {
window.tinyMCE.onAddEditor.add(Y.bind(this.init_tinymce_editor, this));
} else if (window.tinyMCE.on) {
var startSaveTimer = this.start_save_timer_if_necessary.bind(this);
window.tinyMCE.on('AddEditor', function(event) {
event.editor.on('Change Undo Redo keydown', startSaveTimer);
});
}
},

/**
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Expand Up @@ -264,7 +264,14 @@ M.mod_quiz.autosave = {
}

this.editor_change_handler = Y.bind(this.editor_changed, this);
window.tinyMCE.onAddEditor.add(Y.bind(this.init_tinymce_editor, this));
if (window.tinyMCE.onAddEditor) {
window.tinyMCE.onAddEditor.add(Y.bind(this.init_tinymce_editor, this));
} else if (window.tinyMCE.on) {
var startSaveTimer = this.start_save_timer_if_necessary.bind(this);
window.tinyMCE.on('AddEditor', function(event) {
event.editor.on('Change Undo Redo keydown', startSaveTimer);
});
}
},

/**
Expand Down
9 changes: 8 additions & 1 deletion mod/quiz/yui/src/autosave/js/autosave.js
Expand Up @@ -265,7 +265,14 @@ M.mod_quiz.autosave = {

Y.log('Found TinyMCE.', 'debug', 'moodle-mod_quiz-autosave');
this.editor_change_handler = Y.bind(this.editor_changed, this);
window.tinyMCE.onAddEditor.add(Y.bind(this.init_tinymce_editor, this));
if (window.tinyMCE.onAddEditor) {
window.tinyMCE.onAddEditor.add(Y.bind(this.init_tinymce_editor, this));
} else if (window.tinyMCE.on) {
var startSaveTimer = this.start_save_timer_if_necessary.bind(this);
window.tinyMCE.on('AddEditor', function(event) {
event.editor.on('Change Undo Redo keydown', startSaveTimer);
});
}
},

/**
Expand Down

0 comments on commit 643d5ec

Please sign in to comment.