From b6e2bd9f0e8d49026c0b02f869124a749d68aac1 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Fri, 14 Mar 2014 20:40:44 +0000 Subject: [PATCH] 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 --- src/wp-includes/js/tinymce/plugins/wpview/plugin.js | 6 +++++- 1 file changed, 5 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 e56e3da334..48775f9d3c 100644 --- a/src/wp-includes/js/tinymce/plugins/wpview/plugin.js +++ b/src/wp-includes/js/tinymce/plugins/wpview/plugin.js @@ -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

if the noneditable node is last if ( event.load || ! event.set ) {