Changeset 31742
- Timestamp:
- 03/12/2015 01:04:59 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/js/mce-view.js
r31740 r31742 462 462 */ 463 463 setIframes: function( head, body, callback, rendered ) { 464 var MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver, 465 importStyles = this.type === 'video' || this.type === 'audio' || this.type === 'playlist'; 464 var MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver; 466 465 467 466 this.getNodes( function( editor, node, content ) { … … 474 473 iframe, iframeDoc, observer, i; 475 474 476 if ( importStyles ) { 477 if ( ! wp.mce.views.sandboxStyles ) { 478 tinymce.each( dom.$( 'link[rel="stylesheet"]', editor.getDoc().head ), function( link ) { 479 if ( link.href && link.href.indexOf( 'skins/lightgray/content.min.css' ) === -1 && 480 link.href.indexOf( 'skins/wordpress/wp-content.css' ) === -1 ) { 481 482 styles += dom.getOuterHTML( link ) + '\n'; 483 } 484 }); 485 486 wp.mce.views.sandboxStyles = styles; 487 } else { 488 styles = wp.mce.views.sandboxStyles; 475 tinymce.each( dom.$( 476 'link[rel="stylesheet"]', 477 editor.getDoc().getElementsByTagName( 'head' )[0] 478 ), function( link ) { 479 if ( 480 link.href && 481 link.href.indexOf( 'skins/lightgray/content.min.css' ) >= 0 && 482 link.href.indexOf( 'skins/wordpress/wp-content.css' ) >= 0 483 ) { 484 styles += dom.getOuterHTML( link ); 489 485 } 490 } 486 } ); 491 487 492 488 content.innerHTML = ''; … … 581 577 } 582 578 583 if ( importStyles ) { 584 editor.on( 'wp-body-class-change', classChange ); 585 586 $( node ).one( 'wp-mce-view-unbind', function() { 587 editor.off( 'wp-body-class-change', classChange ); 588 } ); 589 } 579 editor.on( 'wp-body-class-change', classChange ); 580 581 $( node ).one( 'wp-mce-view-unbind', function() { 582 editor.off( 'wp-body-class-change', classChange ); 583 } ); 590 584 591 585 callback && callback.apply( this, arguments );
Note: See TracChangeset
for help on using the changeset viewer.