Media: Don't try to resize the bottom selection UI. props koopersmith. fixes #22748.
git-svn-id: http://core.svn.wordpress.org/trunk@23056 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
dc9e6144be
commit
e1405b6f1d
|
@ -3111,7 +3111,8 @@
|
||||||
refreshSensitivity: 200,
|
refreshSensitivity: 200,
|
||||||
refreshThreshold: 3,
|
refreshThreshold: 3,
|
||||||
AttachmentView: media.view.Attachment,
|
AttachmentView: media.view.Attachment,
|
||||||
sortable: false
|
sortable: false,
|
||||||
|
resize: true
|
||||||
});
|
});
|
||||||
|
|
||||||
this._viewsByCid = {};
|
this._viewsByCid = {};
|
||||||
|
@ -3140,7 +3141,8 @@
|
||||||
_.bindAll( this, 'css' );
|
_.bindAll( this, 'css' );
|
||||||
this.model.on( 'change:edge change:gutter', this.css, this );
|
this.model.on( 'change:edge change:gutter', this.css, this );
|
||||||
this._resizeCss = _.debounce( _.bind( this.css, this ), this.refreshSensitivity );
|
this._resizeCss = _.debounce( _.bind( this.css, this ), this.refreshSensitivity );
|
||||||
$(window).on( 'resize.attachments', this._resizeCss );
|
if ( this.options.resize )
|
||||||
|
$(window).on( 'resize.attachments', this._resizeCss );
|
||||||
this.css();
|
this.css();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -3170,7 +3172,6 @@
|
||||||
if ( ! this.$el.is(':visible') )
|
if ( ! this.$el.is(':visible') )
|
||||||
return edge;
|
return edge;
|
||||||
|
|
||||||
|
|
||||||
gutter = this.model.get('gutter') * 2;
|
gutter = this.model.get('gutter') * 2;
|
||||||
width = this.$el.width() - gutter;
|
width = this.$el.width() - gutter;
|
||||||
columns = Math.ceil( width / ( edge + gutter ) );
|
columns = Math.ceil( width / ( edge + gutter ) );
|
||||||
|
@ -3667,18 +3668,14 @@
|
||||||
clearable: true
|
clearable: true
|
||||||
});
|
});
|
||||||
|
|
||||||
this.attachments = new media.view.Attachments({
|
this.attachments = new media.view.Attachments.Selection({
|
||||||
controller: this.controller,
|
controller: this.controller,
|
||||||
collection: this.collection,
|
collection: this.collection,
|
||||||
selection: this.collection,
|
selection: this.collection,
|
||||||
sortable: true,
|
|
||||||
model: new Backbone.Model({
|
model: new Backbone.Model({
|
||||||
edge: 40,
|
edge: 40,
|
||||||
gutter: 5
|
gutter: 5
|
||||||
}),
|
})
|
||||||
|
|
||||||
// The single `Attachment` view to be used in the `Attachments` view.
|
|
||||||
AttachmentView: media.view.Attachment.Selection
|
|
||||||
});
|
});
|
||||||
|
|
||||||
this.views.set( '.selection-view', this.attachments );
|
this.views.set( '.selection-view', this.attachments );
|
||||||
|
@ -3732,6 +3729,26 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* wp.media.view.Attachments.Selection
|
||||||
|
*/
|
||||||
|
media.view.Attachments.Selection = media.view.Attachments.extend({
|
||||||
|
events: {},
|
||||||
|
initialize: function() {
|
||||||
|
_.defaults( this.options, {
|
||||||
|
sortable: true,
|
||||||
|
resize: false,
|
||||||
|
|
||||||
|
// The single `Attachment` view to be used in the `Attachments` view.
|
||||||
|
AttachmentView: media.view.Attachment.Selection
|
||||||
|
});
|
||||||
|
return media.view.Attachments.prototype.initialize.apply( this, arguments );
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* wp.media.view.Attachments.EditSelection
|
||||||
|
*/
|
||||||
media.view.Attachment.EditSelection = media.view.Attachment.Selection.extend({
|
media.view.Attachment.EditSelection = media.view.Attachment.Selection.extend({
|
||||||
buttons: {
|
buttons: {
|
||||||
close: true
|
close: true
|
||||||
|
|
Loading…
Reference in New Issue