mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 20:42:22 +02:00
MDL-75244 form: Change checker should check existence of tinyMCE API
The window.tinyMCE.editors API was present in version 3 of TinyMCE, but is not present in later versions. As a result, this check tries to loop over a variable which does not exist and throws an error in the process. We should check that window.tinyMCE *and* window.tinyMCE.editors both exist before attempting to loop over them.
This commit is contained in:
parent
4ce642e8ba
commit
c48c431374
2
lib/form/amd/build/changechecker.min.js
vendored
2
lib/form/amd/build/changechecker.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -272,7 +272,7 @@ export const isAnyWatchedFormDirty = () => {
|
||||
// Handle TinyMCE editor instances.
|
||||
// TinyMCE forms may not have been initialised at the time that startWatching is called.
|
||||
// Check whether any tinyMCE editor is dirty.
|
||||
if (typeof window.tinyMCE !== 'undefined') {
|
||||
if (typeof window.tinyMCE !== 'undefined' && window.tinyMCE.editors) {
|
||||
if (window.tinyMCE.editors.some(editor => editor.isDirty())) {
|
||||
return true;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user