Make WordPress Core

Changeset 22597


Ignore:
Timestamp:
11/15/2012 03:09:35 AM (12 years ago)
Author:
koopersmith
Message:

Media: Only show the edit selection link for the media library. Make the upload attachments list sortable. Only retain the silent option when running Attachments.validate(). see #21390.

Location:
trunk/wp-includes/js
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/js/media-models.js

    r22578 r22597  
    359359
    360360        validate: function( attachment, options ) {
     361            // Only retain the `silent` option.
     362            options = {
     363                silent: options && options.silent
     364            };
     365
    361366            return this[ this.validator( attachment ) ? 'add' : 'remove' ]( attachment, options );
    362367        },
  • trunk/wp-includes/js/media-views.js

    r22594 r22597  
    459459    media.controller.Upload = media.controller.Library.extend({
    460460        defaults: _.defaults({
    461             id:     'upload',
    462             upload: { text: l10n.uploadMoreFiles },
    463             searchable: false
     461            id:         'upload',
     462            upload:     { text: l10n.uploadMoreFiles },
     463            searchable: false,
     464            sortable:   true
    464465        }, media.controller.Library.prototype.defaults ),
    465466
     
    472473            if ( ! library ) {
    473474                library = new Attachments();
    474                 library.props.set({
    475                     orderby: 'date',
    476                     order:   'ASC'
    477                 });
    478475                library.observe( wp.Uploader.queue );
    479476                this.set( 'library', library );
     
    996993                new media.controller.Library( _.defaults({
    997994                    selection: options.selection,
    998                     library:   media.query( options.library )
     995                    library:   media.query( options.library ),
     996                    editable:  true
    999997                }, main ) ),
    1000998
     
    12571255        mainAttachmentsToolbar: function() {
    12581256            this.toolbar.view( new media.view.Toolbar.Insert({
    1259                 controller: this
     1257                controller: this,
     1258                editable:   this.state().get('editable')
    12601259            }) );
    12611260        },
     
    17711770                    priority:   -40,
    17721771
    1773                     editable: function() {
     1772                    // If the selection is editable, pass the callback to
     1773                    // switch the content mode.
     1774                    editable: this.options.editable && function() {
    17741775                        this.controller.content.mode('edit-selection');
    17751776                    }
Note: See TracChangeset for help on using the changeset viewer.