Make WordPress Core

Ticket #22775: 22775.diff

File 22775.diff, 1.7 KB (added by koopersmith, 12 years ago)
  • wp-admin/js/custom-background.js

     
    3232                        }
    3333
    3434                        // Create the media frame.
    35                         frame = wp.media({
     35                        frame = wp.media.frames.customBackground = wp.media({
    3636                                // Set the title of the modal.
    3737                                title: $el.data('choose'),
    3838
  • wp-admin/js/custom-header.js

     
    1818                        var $el = $(this);
    1919                        event.preventDefault();
    2020
     21                        // If the media frame already exists, reopen it.
     22                        if ( frame ) {
     23                                frame.open();
     24                                return;
     25                        }
     26
    2127                        // Create the media frame.
    22                         frame = wp.media({
     28                        frame = wp.media.frames.customHeader = wp.media({
    2329                                // Set the title of the modal.
    2430                                title: $el.data('choose'),
    2531
  • wp-includes/js/media-models.js

     
    3434                return frame;
    3535        };
    3636
    37         _.extend( media, { model: {}, view: {}, controller: {} });
     37        _.extend( media, { model: {}, view: {}, controller: {}, frames: {} });
    3838
    3939        // Link any localized strings.
    4040        l10n = media.model.l10n = typeof _wpMediaModelsL10n === 'undefined' ? {} : _wpMediaModelsL10n;
     
    216216         * ========================================================================
    217217         */
    218218
     219         /**
     220          * wp.media.attachment
     221          */
     222         media.attachment = function( id ) {
     223                return Attachment.get( id );
     224         };
     225
    219226        /**
    220227         * wp.media.model.Attachment
    221228         */