Merge branch 'MDL-36803-m25' of https://github.com/andrewnicols/moodle into MOODLE_25_STABLE

This commit is contained in:
Damyon Wiese
2013-08-26 09:29:53 +08:00
+15
View File
@@ -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');