Changeset 29191
- Timestamp:
- 07/16/2014 06:18:18 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/js/mce-view.js
r29189 r29191 130 130 131 131 node = $( node ).find( '.wpview-content' )[0]; 132 133 if ( node ) {134 node.innerHTML = '';135 }132 if ( ! node ) { 133 return; 134 } 135 node.innerHTML = ''; 136 136 137 137 iframe = dom.add( node, 'iframe', { … … 512 512 _.bindAll( this, 'createIframe', 'setNode', 'fetch', 'pausePlayers' ); 513 513 $( this ).on( 'ready', this.setNode ); 514 515 $( document ).on( 'media:edit', this.pausePlayers ); 514 516 }, 515 517 516 518 setNode: function ( event, editor, node ) { 517 this.node = node; 519 if ( node ) { 520 this.node = node; 521 } 518 522 editor.on( 'hide', this.pausePlayers ); 519 523 … … 574 578 pausePlayers: function() { 575 579 var p, win = $( 'iframe', this.node ).get(0).contentWindow; 576 if ( win .mejs ) {580 if ( win && win.mejs ) { 577 581 for ( p in win.mejs.players ) { 578 582 win.mejs.players[p].pause(); 583 } 584 } 585 }, 586 587 unsetPlayers: function() { 588 var p, win = $( 'iframe', this.node ).get(0).contentWindow; 589 if ( win && win.mejs ) { 590 for ( p in win.mejs.players ) { 579 591 win.mejs.players[p].remove(); 580 592 } 581 593 } 594 }, 595 596 unbind: function() { 597 this.pausePlayers(); 598 this.unsetPlayers(); 582 599 } 583 600 },
Note: See TracChangeset
for help on using the changeset viewer.