WordPress.org

Make WordPress Core

Changeset 28784


Ignore:
Timestamp:
06/20/2014 04:29:47 PM (6 years ago)
Author:
wonderboymusic
Message:

Further adjustments after [8364], listen to an editor instance event instead of delegating a body click when attempting to pause all players belonging to a particular MCE view.

Props avryl.
Fixes #27971.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/js/mce-view.js

    r28775 r28784  
    418418                _.bindAll( this, 'setPlayer', 'pausePlayers' );
    419419                $( this ).on( 'ready', this.setPlayer );
    420                 $( 'body' ).on( 'click', '.wp-switch-editor', this.pausePlayers );
     420                $( this ).on( 'ready', function( event, editor ) {
     421                    editor.on( 'hide', this.pausePlayers );
     422                } );
    421423                $( document ).on( 'media:edit', this.pausePlayers );
    422424            },
     
    559561                this.shortcode = options.shortcode;
    560562
    561                 $( 'body' ).on( 'click', '.wp-switch-editor', this.pausePlayers );
     563                $( this ).on( 'ready', function( event, editor ) {
     564                    editor.on( 'hide', this.pausePlayers );
     565                } );
    562566                $( document ).on( 'media:edit', this.pausePlayers );
    563567
Note: See TracChangeset for help on using the changeset viewer.