MDL-65450 tinymce: fix full screen mode
authorRyan Wyllie <ryan@moodle.com>
Wed, 1 May 2019 05:58:09 +0000 (13:58 +0800)
committerRyan Wyllie <ryan@moodle.com>
Wed, 1 May 2019 06:20:10 +0000 (14:20 +0800)
lib/editor/tinymce/module.js

index ee8e4d9..e5eb76c 100644 (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');
         });
         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);
+            }
         });
     };
 
         });
     };