Make WordPress Core

Ticket #27416: 27416-01.patch

File 27416-01.patch, 718 bytes (added by gcorne, 12 years ago)
  • src/wp-includes/js/tinymce/plugins/wpview/plugin.js

    diff --git src/wp-includes/js/tinymce/plugins/wpview/plugin.js src/wp-includes/js/tinymce/plugins/wpview/plugin.js
    index e56e3da..48775f9 100644
    tinymce.PluginManager.add( 'wpview', function( editor ) { 
    140140        editor.on( 'SetContent', function( event ) {
    141141                var body, padNode;
    142142
    143                 wp.mce.views.render();
     143                // don't (re-)render views if the format of the content is raw
     144                // to avoid adding additional undo levels on undo/redo
     145                if ( event.format !== 'raw' ) {
     146                        wp.mce.views.render();
     147                }
    144148
    145149                // Add padding <p> if the noneditable node is last
    146150                if ( event.load || ! event.set ) {