MCE Views: don't (re-)render views if the format of the content is "raw" to avoid adding additional undo levels on undo/redo.

Props gcorne.
Fixes #27416.



git-svn-id: https://develop.svn.wordpress.org/trunk@27544 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor 2014-03-14 20:40:44 +00:00
parent a339826668
commit b6e2bd9f0e

View File

@ -140,7 +140,11 @@ tinymce.PluginManager.add( 'wpview', function( editor ) {
editor.on( 'SetContent', function( event ) {
var body, padNode;
wp.mce.views.render();
// don't (re-)render views if the format of the content is raw
// to avoid adding additional undo levels on undo/redo
if ( event.format !== 'raw' ) {
wp.mce.views.render();
}
// Add padding <p> if the noneditable node is last
if ( event.load || ! event.set ) {