TinyMCE: fix editor focus issues after ontouchstart event on the parent document in iOS Safari. Fixes #25131 for 3.7.

git-svn-id: https://develop.svn.wordpress.org/trunk@25132 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz 2013-08-26 21:23:58 +00:00
parent 7694a64c06
commit afe41b9134
1 changed files with 10 additions and 0 deletions

View File

@ -228,6 +228,16 @@
o.content = o.content.replace(/<p>(<br ?\/?>|\u00a0|\uFEFF)?<\/p>/g, '<p>&nbsp;</p>');
});
// Fix bug in iOS Safari where it's impossible to type after a touchstart event on the parent document.
// Happens after zooming in or out while the keyboard is open. See #25131.
if ( tinymce.isIOS5 ) {
ed.onKeyDown.add( function() {
if ( document.activeElement == document.body ) {
ed.getWin().focus();
}
});
}
ed.onSaveContent.add(function(ed, o) {
// If editor is hidden, we just want the textarea's value to be saved
if ( ed.isHidden() )