WordPress.org

Make WordPress Core

Ticket #22696: sortable-options-hash.diff

File sortable-options-hash.diff, 737 bytes (added by markjaquith, 5 years ago)

Patch from Koop to allow you to override the default sortable options by passing in a hash instead of bool to sortable

  • wp-includes/js/media-views.js

     
    31863186                        if ( ! this.options.sortable || ! $.fn.sortable )
    31873187                                return;
    31883188
    3189                         this.$el.sortable({
     3189                        this.$el.sortable( _.extend({
    31903190                                // If the `collection` has a `comparator`, disable sorting.
    31913191                                disabled: !! collection.comparator,
    31923192
     
    32313231                                        // update the menu order.
    32323232                                        collection.saveMenuOrder();
    32333233                                }
    3234                         });
     3234                        }, this.options.sortable ) );
    32353235
    32363236                        // If the `orderby` property is changed on the `collection`,
    32373237                        // check to see if we have a `comparator`. If so, disable sorting.