Ticket #28788: 28788.patch
File 28788.patch, 2.5 KB (added by , 9 years ago) |
---|
-
src/wp-includes/js/mce-view.js
46 46 '<div class="wpview-loading"><ins></ins></div>' + 47 47 '</div>'; 48 48 }, 49 render: function() { 49 render: function( force ) { 50 if ( this.rendered() && ! force ) { 51 return; 52 } 53 54 this.unbind(); 55 50 56 this.setContent( 51 57 '<p class="wpview-selection-before">\u00a0</p>' + 52 58 '<div class="wpview-body" contenteditable="false">' + … … 64 70 ); 65 71 66 72 $( this ).trigger( 'ready' ); 73 74 this.rendered( true ); 67 75 }, 68 76 unbind: function() {}, 69 77 getEditors: function( callback ) { … … 186 194 '<p>' + message + '</p>' + 187 195 '</div>' 188 196 ); 197 }, 198 rendered: function( value ) { 199 var notRendered; 200 201 this.getNodes( function( editor, node ) { 202 if ( value != null ) { 203 $( node ).data( 'rendered', value === true ); 204 } else { 205 notRendered = notRendered || ! $( node ).data( 'rendered' ); 206 } 207 } ); 208 209 return ! notRendered; 189 210 } 190 211 } ); 191 212 … … 386 407 instances[ encodedText ] = instance; 387 408 } 388 409 389 wp.mce.views.render();410 instance.render( true ); 390 411 }, 391 412 392 413 getInstance: function( encodedText ) { … … 402 423 * To generate wrapper elements, pass your content through 403 424 * `wp.mce.view.toViews( content )`. 404 425 */ 405 render: function( ) {426 render: function( force ) { 406 427 _.each( instances, function( instance ) { 407 instance.render( );428 instance.render( force ); 408 429 } ); 409 430 }, 410 431 … … 434 455 }, 435 456 436 457 fetch: function() { 458 var self = this; 459 437 460 this.attachments = wp.media.gallery.attachments( this.shortcode, this.postID ); 438 this.dfd = this.attachments.more().done( _.bind( this.render, this ) ); 461 this.dfd = this.attachments.more().done( function() { 462 self.render( true ); 463 } ); 439 464 }, 440 465 441 466 getHtml: function() { -
src/wp-includes/js/tinymce/plugins/wpview/plugin.js
205 205 removeView( selected ); 206 206 } 207 207 208 if ( ! event.initial ) {209 wp.mce.views.unbind( editor );210 }211 212 208 node = editor.selection.getNode(); 213 209 214 210 // When a url is pasted, only try to embed it when pasted in an empty paragrapgh.