Skip to content

Commit

Permalink
Merge branch 'MDL-75782-master' of https://github.com/andrewnicols/mo…
Browse files Browse the repository at this point in the history
  • Loading branch information
junpataleta committed Sep 29, 2022
2 parents 0c7243a + a0afccf commit 590a695
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 4 deletions.
Original file line number Diff line number Diff line change
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.

Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 590a695

Please sign in to comment.