Make WordPress Core

Ticket #34152: 34152.2.patch

File 34152.2.patch, 1.2 KB (added by Fab1en, 9 years ago)

Use jQuery instead of Underscore to clone the settings object when needed

  • src/wp-includes/js/mediaelement/wp-mediaelement.js

    diff --git a/src/wp-includes/js/mediaelement/wp-mediaelement.js b/src/wp-includes/js/mediaelement/wp-mediaelement.js
    index fe47d2f..75e6b8e 100644
    a b  
    2020                 */
    2121                function initialize() {
    2222                        if ( typeof _wpmejsSettings !== 'undefined' ) {
    23                                 settings = _wpmejsSettings;
     23                                settings = $.extend(true, {}, _wpmejsSettings );
    2424                        }
    2525
    2626                        settings.success = settings.success || function (mejs) {
  • src/wp-includes/js/mediaelement/wp-playlist.js

    diff --git a/src/wp-includes/js/mediaelement/wp-playlist.js b/src/wp-includes/js/mediaelement/wp-playlist.js
    index 90839a5..fc21d82 100644
    a b  
    3131                        _.bindAll( this, 'bindPlayer', 'bindResetPlayer', 'setPlayer', 'ended', 'clickTrack' );
    3232
    3333                        if ( ! _.isUndefined( window._wpmejsSettings ) ) {
    34                                 this.settings = _wpmejsSettings;
     34                                this.settings = _.clone(_wpmejsSettings);
    3535                        }
    3636                        this.settings.success = this.bindPlayer;
    3737                        this.setPlayer();
     
    172172
    173173        window.WPPlaylistView = WPPlaylistView;
    174174
    175 }(jQuery, _, Backbone));
    176  No newline at end of file
     175}(jQuery, _, Backbone));