Changeset 29182
- Timestamp:
- 07/15/2014 11:38:33 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/js/tinymce/plugins/wpview/plugin.js
r29127 r29182 267 267 }); 268 268 269 // When the selection's content changes, scan any new content for matching views.270 // Runs on paste and on inserting nodes/html.271 editor.on( 'SetContent', function( e ) {272 if ( ! e.context ) {273 return;274 }275 276 var node = selection.getNode();277 278 if ( ! node.innerHTML ) {279 return;280 }281 282 node.innerHTML = wp.mce.views.toViews( node.innerHTML );283 });284 285 269 editor.dom.bind( editor.getBody().parentNode, 'mousedown mouseup click', function( event ) { 286 270 var view = getView( event.target ), … … 328 312 329 313 editor.on( 'PreProcess', function( event ) { 330 // Replace the wpview node with the wpview string/shortcode?314 // Empty the wpview wrap nodes 331 315 tinymce.each( editor.dom.select( 'div[data-wpview-text]', event.node ), function( node ) { 332 // Empty the wrap node 333 if ( 'textContent' in node ) { 334 node.textContent = '\u00a0'; 335 } else { 336 node.innerText = '\u00a0'; 337 } 316 node.textContent = node.innerText = '\u00a0'; 338 317 }); 339 318 });
Note: See TracChangeset for help on using the changeset viewer.