From 312edcbc9d914a775b75e8be47364b67d976f43e Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Tue, 21 Apr 2015 21:31:26 +0000 Subject: [PATCH] TinyMCE wpView: properly deselect views when hiding the editor. Do not remove `selected` on PreProcess. Fixes #32045. git-svn-id: https://develop.svn.wordpress.org/trunk@32257 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/js/tinymce/plugins/wpview/plugin.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/wp-includes/js/tinymce/plugins/wpview/plugin.js b/src/wp-includes/js/tinymce/plugins/wpview/plugin.js index 4c9f2f3eef..3a69af7538 100644 --- a/src/wp-includes/js/tinymce/plugins/wpview/plugin.js +++ b/src/wp-includes/js/tinymce/plugins/wpview/plugin.js @@ -361,9 +361,6 @@ tinymce.PluginManager.add( 'wpview', function( editor ) { // Remove marker attributes $( 'p[data-wpview-marker]', rootNode ).attr( 'data-wpview-marker', null ); - - // Reset the selected node if any - selected = null; } editor.on( 'PreProcess', function( event ) { @@ -374,6 +371,7 @@ tinymce.PluginManager.add( 'wpview', function( editor ) { editor.on( 'hide', function() { // Replace the view nodes with their text directly in the editor body. wp.mce.views.unbind(); + deselect(); resetViews( editor.getBody() ); });