diff --git a/src/wp-includes/js/mce-view.js b/src/wp-includes/js/mce-view.js index feb7607e2a..baaaf72928 100644 --- a/src/wp-includes/js/mce-view.js +++ b/src/wp-includes/js/mce-view.js @@ -417,7 +417,9 @@ window.wp = window.wp || {}; this.shortcode = options.shortcode; _.bindAll( this, 'setPlayer', 'pausePlayers' ); $( this ).on( 'ready', this.setPlayer ); - $( 'body' ).on( 'click', '.wp-switch-editor', this.pausePlayers ); + $( this ).on( 'ready', function( event, editor ) { + editor.on( 'hide', this.pausePlayers ); + } ); $( document ).on( 'media:edit', this.pausePlayers ); }, @@ -558,7 +560,9 @@ window.wp = window.wp || {}; this.attachments = []; this.shortcode = options.shortcode; - $( 'body' ).on( 'click', '.wp-switch-editor', this.pausePlayers ); + $( this ).on( 'ready', function( event, editor ) { + editor.on( 'hide', this.pausePlayers ); + } ); $( document ).on( 'media:edit', this.pausePlayers ); this.fetch();