Changeset 23056
- Timestamp:
- 12/05/2012 01:38:44 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/js/media-views.js
r23053 r23056 3112 3112 refreshThreshold: 3, 3113 3113 AttachmentView: media.view.Attachment, 3114 sortable: false 3114 sortable: false, 3115 resize: true 3115 3116 }); 3116 3117 … … 3141 3142 this.model.on( 'change:edge change:gutter', this.css, this ); 3142 3143 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 ); 3144 3146 this.css(); 3145 3147 }, … … 3170 3172 if ( ! this.$el.is(':visible') ) 3171 3173 return edge; 3172 3173 3174 3174 3175 gutter = this.model.get('gutter') * 2; … … 3668 3669 }); 3669 3670 3670 this.attachments = new media.view.Attachments ({3671 this.attachments = new media.view.Attachments.Selection({ 3671 3672 controller: this.controller, 3672 3673 collection: this.collection, 3673 3674 selection: this.collection, 3674 sortable: true,3675 3675 model: new Backbone.Model({ 3676 3676 edge: 40, 3677 3677 gutter: 5 3678 }), 3679 3680 // The single `Attachment` view to be used in the `Attachments` view. 3681 AttachmentView: media.view.Attachment.Selection 3678 }) 3682 3679 }); 3683 3680 … … 3733 3730 }); 3734 3731 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 */ 3735 3752 media.view.Attachment.EditSelection = media.view.Attachment.Selection.extend({ 3736 3753 buttons: {
Note: See TracChangeset
for help on using the changeset viewer.