Ticket #31669: 31669.patch
File 31669.patch, 1.8 KB (added by , 10 years ago) |
---|
-
src/wp-includes/js/mce-view.js
77 77 */ 78 78 unbind: function() { 79 79 _.each( instances, function( instance ) { 80 instance.unbind ();80 instance.unbindAll(); 81 81 } ); 82 82 }, 83 83 … … 307 307 } 308 308 309 309 // We're about to rerender all views of this instance, so unbind rendered views. 310 force && this.unbind ();310 force && this.unbindAll(); 311 311 312 312 // Replace any left over markers. 313 313 this.replaceMarkers(); 314 314 315 315 if ( this.getContent() ) { 316 316 this.setContent( this.getContent(), function( editor, node ) { 317 $( node ).data( 'rendered', true ).trigger( 'wp-mce-view-bind' ); 317 $( node ).data( 'rendered', true ); 318 this.bind.apply( this, arguments ); 318 319 }, force ? null : false ); 319 320 } else { 320 321 this.setLoader(); … … 322 323 }, 323 324 324 325 /** 326 * Binds a given node after its content is added to the DOM. 327 */ 328 bind: function() {}, 329 330 /** 331 * Unbinds a given node before its content is removed from the DOM. 332 */ 333 unbind: function() {}, 334 335 /** 325 336 * Unbinds all view nodes tied to this view instance. 326 337 * Runs before their content is removed from the DOM. 327 338 */ 328 unbind : function() {339 unbindAll: function() { 329 340 this.getNodes( function( editor, node ) { 341 this.unbind.apply( this, arguments ); 330 342 $( node ).trigger( 'wp-mce-view-unbind' ); 331 343 }, true ); 332 344 }, … … 663 675 * @param {HTMLElement} node The view node to remove. 664 676 */ 665 677 remove: function( editor, node ) { 678 this.unbind.call( this, editor, node, $( node ).find( '.wpview-content' ).get( 0 ) ); 666 679 $( node ).trigger( 'wp-mce-view-unbind' ); 667 680 editor.dom.remove( node ); 668 681 }