TinyMCE: Fix cursor position after updating a wpview node. Fix hiding the inline toolbar on editor blur.

Props iseulde, azaozz.

Merges [40481] to the 4.7 branch.
Fixes #40480.

Built from https://develop.svn.wordpress.org/branches/4.7@40482


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40358 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Ozz 2017-04-19 22:18:36 +00:00
parent 9e791361e1
commit 84387613b6
5 changed files with 6 additions and 3 deletions

View File

@ -708,6 +708,9 @@
$( node ).data( 'rendered', false );
editor.dom.setAttrib( node, 'data-wpview-text', encodeURIComponent( text ) );
wp.mce.views.createInstance( type, text, match.options, force ).render();
editor.selection.select( node );
editor.nodeChanged();
editor.focus();
return true;

File diff suppressed because one or more lines are too long

View File

@ -982,7 +982,7 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) {
function hide( event ) {
if ( activeToolbar ) {
if ( activeToolbar.tempHide || event.type === 'hide' ) {
if ( activeToolbar.tempHide || event.type === 'hide' || event.type === 'blur' ) {
activeToolbar.hide();
activeToolbar = false;
} else if ( (

File diff suppressed because one or more lines are too long