Make WordPress Core

Changeset 22985


Ignore:
Timestamp:
12/03/2012 04:54:03 AM (14 years ago)
Author:
nacin
Message:

Media: Don't add menu_order to newly uploaded attachments, to match 3.4 behavior. Reverts a bit of [22967]. props koopersmith. fixes #22607.

File:
1 edited

Legend:

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

    r22984 r22985  
    28142814
    28152815                initSortable: function() {
    2816                         var view = this,
    2817                                 collection = this.collection,
     2816                        var collection = this.collection,
    28182817                                from;
    28192818
    … …  
    28612860                                        // If the collection is sorted by menu order,
    28622861                                        // update the menu order.
    2863                                         view.saveMenuOrder();
    2864 
    2865                                         // Make sure any menu-order-related callbacks are bound.
    2866                                         view.refreshSortable();
     2862                                        collection.saveMenuOrder();
    28672863                                }
    28682864                        });
    … …  
    28852881                        var collection = this.collection,
    28862882                                orderby = collection.props.get('orderby'),
    2887                                 enabled = 'menuOrder' === orderby || ! collection.comparator,
    2888                                 hasMenuOrder;
     2883                                enabled = 'menuOrder' === orderby || ! collection.comparator;
    28892884
    28902885                        this.$el.sortable( 'option', 'disabled', ! enabled );
    2891 
    2892                         // Check if any attachments have a specified menu order.
    2893                         hasMenuOrder = this.collection.any( function( attachment ) {
    2894                                 return attachment.get('menuOrder');
    2895                         });
    2896 
    2897                         // Always unbind the `saveMenuOrder` callback to prevent multiple
    2898                         // callbacks stacking up.
    2899                         this.collection.off( 'change:uploading', this.saveMenuOrder, this );
    2900 
    2901                         if ( hasMenuOrder )
    2902                                 this.collection.on( 'change:uploading', this.saveMenuOrder, this );
    2903 
    2904                 },
    2905 
    2906                 saveMenuOrder: function() {
    2907                         this.collection.saveMenuOrder();
    29082886                },
    29092887
Note: See TracChangeset for help on using the changeset viewer.