Changeset 32711
- Timestamp:
- 06/08/2015 09:31:39 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/js/mce-view.js
r32710 r32711 502 502 } ); 503 503 504 if ( self.iframeHeight ) { 505 dom.add( contentNode, 'div', { style: { 506 width: '100%', 507 height: self.iframeHeight 508 } } ); 509 } 510 504 511 // Seems the browsers need a bit of time to insert/set the view nodes, 505 512 // or the iframe will fail especially when switching Text => Visual. 506 513 setTimeout( function() { 507 var iframe, iframeDoc, observer, i ;514 var iframe, iframeDoc, observer, i, block; 508 515 509 516 contentNode.innerHTML = ''; … … 519 526 width: '100%', 520 527 display: 'block' 521 } 528 }, 529 height: self.iframeHeight 522 530 } ); 523 531 … … 562 570 563 571 function resize() { 564 var $iframe, iframeDocHeight; 572 var $iframe; 573 574 if ( block ) { 575 return; 576 } 565 577 566 578 // Make sure the iframe still exists. 567 579 if ( iframe.contentWindow ) { 568 580 $iframe = $( iframe ); 569 iframeDocHeight = $( iframeDoc.body ).height();570 571 if ( $iframe.height() !== iframeDocHeight ) {572 $iframe.height( iframeDocHeight );581 self.iframeHeight = $( iframeDoc.body ).height(); 582 583 if ( $iframe.height() !== self.iframeHeight ) { 584 $iframe.height( self.iframeHeight ); 573 585 editor.nodeChanged(); 574 586 } 575 587 } 588 } 589 590 if ( self.iframeHeight ) { 591 block = true; 592 593 setTimeout( function() { 594 block = false; 595 resize(); 596 }, 3000 ); 576 597 } 577 598
Note: See TracChangeset
for help on using the changeset viewer.