Changeset 22985
- Timestamp:
- 12/03/2012 04:54:03 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/js/media-views.js
r22984 r22985 2814 2814 2815 2815 initSortable: function() { 2816 var view = this, 2817 collection = this.collection, 2816 var collection = this.collection, 2818 2817 from; 2819 2818 … … 2861 2860 // If the collection is sorted by menu order, 2862 2861 // update the menu order. 2863 view.saveMenuOrder(); 2864 2865 // Make sure any menu-order-related callbacks are bound. 2866 view.refreshSortable(); 2862 collection.saveMenuOrder(); 2867 2863 } 2868 2864 }); … … 2885 2881 var collection = this.collection, 2886 2882 orderby = collection.props.get('orderby'), 2887 enabled = 'menuOrder' === orderby || ! collection.comparator, 2888 hasMenuOrder; 2883 enabled = 'menuOrder' === orderby || ! collection.comparator; 2889 2884 2890 2885 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 multiple2898 // 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();2908 2886 }, 2909 2887
Note: See TracChangeset
for help on using the changeset viewer.