Make WordPress Core

Changeset 22044


Ignore:
Timestamp:
09/27/2012 06:20:22 AM (14 years ago)
Author:
koopersmith
Message:

Media JS: Move the modal box's title from being stored in the modal view to being stored as an attribute on the workflow. Update modal titles for both the post media and featured image workflows. see #21390, #21776.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/meta-boxes.php

    r22022 r22044  
    10321032                        if ( ! workflow ) {
    10331033                                workflow = wp.media({
     1034                                        title:   title,
    10341035                                        library: {
    10351036                                                type: 'image'
     
    10591060                                        }).prependTo( $element );
    10601061                                });
    1061                                 workflow.modal.title( title );
    10621062                        }
    10631063
  • trunk/wp-admin/js/media-upload.js

    r22036 r22044  
    104104
    105105                        workflow = workflows[ id ] = wp.media( _.defaults( options || {}, {
     106                                title:    wp.media.view.l10n.insertMedia,
    106107                                multiple: true
    107108                        } ) );
  • trunk/wp-includes/js/media-views.js

    r22040 r22044  
    2020        media.controller.Workflow = Backbone.Model.extend({
    2121                defaults: {
     22                        title:     '',
    2223                        multiple:  false,
    2324                        view:      'library',
     
    194195                initialize: function() {
    195196                        this.controller = this.options.controller;
     197                        this.controller.on( 'change:title', this.render, this );
    196198
    197199                        _.defaults( this.options, {
    198                                 title: '',
    199200                                container: document.body
    200201                        });
     
    209210                        this.options.$content.detach();
    210211
    211                         this.$el.html( this.template( this.options ) );
     212                        this.$el.html( this.template( this.controller.toJSON() ) );
    212213                        this.$('.media-modal-content').append( this.options.$content );
    213214                        return this;
     
    242243                        // Set and render the content.
    243244                        this.options.$content = ( $content instanceof Backbone.View ) ? $content.$el : $content;
    244                         return this.render();
    245                 },
    246 
    247                 title: function( title ) {
    248                         this.options.title = title;
    249245                        return this.render();
    250246                }
Note: See TracChangeset for help on using the changeset viewer.