Make WordPress Core

Changeset 23056


Ignore:
Timestamp:
12/05/2012 01:38:44 AM (12 years ago)
Author:
nacin
Message:

Media: Don't try to resize the bottom selection UI. props koopersmith. fixes #22748.

File:
1 edited

Legend:

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

    r23053 r23056  
    31123112                refreshThreshold:   3,
    31133113                AttachmentView:     media.view.Attachment,
    3114                 sortable:           false
     3114                sortable:           false,
     3115                resize:             true
    31153116            });
    31163117
     
    31413142            this.model.on( 'change:edge change:gutter', this.css, this );
    31423143            this._resizeCss = _.debounce( _.bind( this.css, this ), this.refreshSensitivity );
    3143             $(window).on( 'resize.attachments', this._resizeCss );
     3144            if ( this.options.resize )
     3145                $(window).on( 'resize.attachments', this._resizeCss );
    31443146            this.css();
    31453147        },
     
    31703172            if ( ! this.$el.is(':visible') )
    31713173                return edge;
    3172 
    31733174
    31743175            gutter  = this.model.get('gutter') * 2;
     
    36683669            });
    36693670
    3670             this.attachments = new media.view.Attachments({
     3671            this.attachments = new media.view.Attachments.Selection({
    36713672                controller: this.controller,
    36723673                collection: this.collection,
    36733674                selection:  this.collection,
    3674                 sortable:   true,
    36753675                model:      new Backbone.Model({
    36763676                    edge:   40,
    36773677                    gutter: 5
    3678                 }),
    3679 
    3680                 // The single `Attachment` view to be used in the `Attachments` view.
    3681                 AttachmentView: media.view.Attachment.Selection
     3678                })
    36823679            });
    36833680
     
    37333730    });
    37343731
     3732    /**
     3733     * wp.media.view.Attachments.Selection
     3734     */
     3735    media.view.Attachments.Selection = media.view.Attachments.extend({
     3736        events: {},
     3737        initialize: function() {
     3738            _.defaults( this.options, {
     3739                sortable:   true,
     3740                resize:     false,
     3741
     3742                // The single `Attachment` view to be used in the `Attachments` view.
     3743                AttachmentView: media.view.Attachment.Selection
     3744            });
     3745            return media.view.Attachments.prototype.initialize.apply( this, arguments );
     3746        }
     3747    });
     3748
     3749    /**
     3750     * wp.media.view.Attachments.EditSelection
     3751     */
    37353752    media.view.Attachment.EditSelection = media.view.Attachment.Selection.extend({
    37363753        buttons: {
Note: See TracChangeset for help on using the changeset viewer.