mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-05 02:10:45 +01:00
Media: Don't add menu_order to newly uploaded attachments, to match 3.4 behavior. Reverts a bit of [22967]. props koopersmith. fixes #22607.
git-svn-id: http://core.svn.wordpress.org/trunk@22985 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
b382901778
commit
6d711428b4
@ -2813,8 +2813,7 @@
|
||||
},
|
||||
|
||||
initSortable: function() {
|
||||
var view = this,
|
||||
collection = this.collection,
|
||||
var collection = this.collection,
|
||||
from;
|
||||
|
||||
if ( ! this.options.sortable || ! $.fn.sortable )
|
||||
@ -2860,10 +2859,7 @@
|
||||
|
||||
// If the collection is sorted by menu order,
|
||||
// update the menu order.
|
||||
view.saveMenuOrder();
|
||||
|
||||
// Make sure any menu-order-related callbacks are bound.
|
||||
view.refreshSortable();
|
||||
collection.saveMenuOrder();
|
||||
}
|
||||
});
|
||||
|
||||
@ -2884,27 +2880,9 @@
|
||||
// If the `collection` has a `comparator`, disable sorting.
|
||||
var collection = this.collection,
|
||||
orderby = collection.props.get('orderby'),
|
||||
enabled = 'menuOrder' === orderby || ! collection.comparator,
|
||||
hasMenuOrder;
|
||||
enabled = 'menuOrder' === orderby || ! collection.comparator;
|
||||
|
||||
this.$el.sortable( 'option', 'disabled', ! enabled );
|
||||
|
||||
// Check if any attachments have a specified menu order.
|
||||
hasMenuOrder = this.collection.any( function( attachment ) {
|
||||
return attachment.get('menuOrder');
|
||||
});
|
||||
|
||||
// Always unbind the `saveMenuOrder` callback to prevent multiple
|
||||
// callbacks stacking up.
|
||||
this.collection.off( 'change:uploading', this.saveMenuOrder, this );
|
||||
|
||||
if ( hasMenuOrder )
|
||||
this.collection.on( 'change:uploading', this.saveMenuOrder, this );
|
||||
|
||||
},
|
||||
|
||||
saveMenuOrder: function() {
|
||||
this.collection.saveMenuOrder();
|
||||
},
|
||||
|
||||
createAttachmentView: function( attachment ) {
|
||||
|
Loading…
Reference in New Issue
Block a user