From 69e9190038e845b5fbb8bb23b71f890f4d0ba018 Mon Sep 17 00:00:00 2001 From: Ryan Wyllie Date: Wed, 1 May 2019 13:58:09 +0800 Subject: [PATCH] MDL-65450 tinymce: fix full screen mode --- lib/editor/tinymce/module.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/editor/tinymce/module.js b/lib/editor/tinymce/module.js index ee8e4d96ae3..e5eb76cac52 100644 --- a/lib/editor/tinymce/module.js +++ b/lib/editor/tinymce/module.js @@ -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); + } }); };