From 8298e94bfe801de413ce04fbb4196b65a54c0419 Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Mon, 22 Dec 2014 21:30:16 +0000 Subject: [PATCH] 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. git-svn-id: https://develop.svn.wordpress.org/trunk@30986 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/js/tinymce/plugins/wpview/plugin.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/wp-includes/js/tinymce/plugins/wpview/plugin.js b/src/wp-includes/js/tinymce/plugins/wpview/plugin.js index 6016e3bdc2..36a76675e2 100644 --- a/src/wp-includes/js/tinymce/plugins/wpview/plugin.js +++ b/src/wp-includes/js/tinymce/plugins/wpview/plugin.js @@ -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 );