wpView: make sure the editor is focused before selecting/deselecting a view, or IE may throw an invalid range error, see #28595.
git-svn-id: https://develop.svn.wordpress.org/trunk@29273 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
c2bd765b32
commit
2d466f4c86
@ -119,6 +119,11 @@ tinymce.PluginManager.add( 'wpview', function( editor ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Make sure that the editor is focused.
|
||||
// It is possible that the editor is not focused when the mouse event fires
|
||||
// without focus, the selection will not work properly.
|
||||
editor.getBody().focus();
|
||||
|
||||
deselect();
|
||||
selected = viewNode;
|
||||
dom.setAttrib( viewNode, 'data-mce-selected', 1 );
|
||||
@ -134,11 +139,6 @@ tinymce.PluginManager.add( 'wpview', function( editor ) {
|
||||
dom.bind( clipboard, 'beforedeactivate focusin focusout', _stop );
|
||||
dom.bind( selected, 'beforedeactivate focusin focusout', _stop );
|
||||
|
||||
// Make sure that the editor is focused.
|
||||
// It is possible that the editor is not focused when the mouse event fires
|
||||
// without focus, the selection will not work properly.
|
||||
editor.getBody().focus();
|
||||
|
||||
// select the hidden div
|
||||
editor.selection.select( clipboard, true );
|
||||
editor.nodeChanged();
|
||||
|
Loading…
Reference in New Issue
Block a user