TinyMCE wpView: when clicking on the Edit button, move the focus back to the editor before opening the modal. This is needed for IE so TinyMCE can save the proper DOM "bookmark", and makes it possible to move the focus to the modal after it is opened.

See #30817.
Built from https://develop.svn.wordpress.org/trunk@30986


git-svn-id: http://core.svn.wordpress.org/trunk@30972 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Ozz 2014-12-22 21:31:26 +00:00
parent b806668e71
commit 441b47b28f
3 changed files with 7 additions and 2 deletions

View File

@ -330,8 +330,13 @@ tinymce.PluginManager.add( 'wpview', function( editor ) {
if ( ( event.type === 'touchend' || event.type === 'mousedown' ) && ! event.metaKey && ! event.ctrlKey ) {
if ( editor.dom.hasClass( event.target, 'edit' ) ) {
// In IE need to transfer focus from the non-editable view back to the editor.
if ( Env.ie ) {
editor.focus();
}
wp.mce.views.edit( view );
editor.focus();
return false;
} else if ( editor.dom.hasClass( event.target, 'remove' ) ) {
removeView( view );

File diff suppressed because one or more lines are too long