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:
Andrew Nacin 2012-12-03 04:54:03 +00:00
parent b382901778
commit 6d711428b4
1 changed files with 3 additions and 25 deletions

View File

@ -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 ) {