Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-36803 TinyMCE: Fix TinyMCE following touch events on iOS browsers

  • Loading branch information...
commit 37ca398629b72ecd93d0f43c5ed0a440718a8eeb 1 parent 661777c
@andrewnicols andrewnicols authored
Showing with 15 additions and 0 deletions.
  1. +15 −0 lib/editor/tinymce/module.js
View
15 lib/editor/tinymce/module.js
@@ -56,6 +56,21 @@ M.editor_tinymce.init_editor = function(Y, editorid, options) {
M.cfg.wwwroot + '/lib/editor/tinymce/plugins/' + filedetails[1]);
}
}
+
+ // We have to override the editor setup to work around a bug in iOS browsers - MDL-36803.
+ if (Y.UA.ios) {
+ // Retain any setup which is already defined.
+ options.originalSetupFunction = options.setup || function(){};
+ options.setup = function(editor) {
+ options.originalSetupFunction();
+ editor.onPostRender.add(function(ed) {
+ // Whenever there is a keydown event, ensure that the contentWindow still have focus.
+ ed.contentDocument.addEventListener('keydown', function() {
+ ed.contentWindow.focus();
+ });
+ });
+ };
+ }
tinyMCE.init(options);
var item = document.getElementById(editorid+'_filemanager');
Please sign in to comment.
Something went wrong with that request. Please try again.