docs/vendor/mixitup/mixitup.js
function() {
            var self        = this,
                instruction = self.parseSortArgs(arguments);

            return self.multimix({
                sort: instruction.command
            }, instruction.animate, instruction.callback);
        }
function() {
            var self        = this,
                instruction = self.parseSortArgs(arguments);

            return self.multimix({
                sort: instruction.command
            }, instruction.animate, instruction.callback);
        }
function ( ) { var self = this , instruction = self . parseSortArgs ( arguments ) ; return self . multimix ( { sort : instruction . command } , instruction . animate , instruction . callback ) ; }
Sorts all targets in the container according to a provided sort string.

@example

.sort(sortString [, animate] [, callback])

@example <caption>Example 1: Sorting by the default DOM order</caption>

// Reverse the default order of the targets

mixer.sort('default:desc')
.then(function(state) {
console.log(state.activeSort.attribute === 'default'); // true
console.log(state.activeSort.order === 'desc'); // true
});

@example <caption>Example 2: Sorting by a custom data-attribute</caption>

// Sort the targets by the value of a `data-published-date` attribute

mixer.sort('published-date:asc')
.then(function(state) {
console.log(state.activeSort.attribute === 'published-date'); // true
console.log(state.activeSort.order === 'asc'); // true
});

@example <caption>Example 3: Sorting by multiple attributes</caption>

// Sort the targets by the value of a `data-published-date` attribute, then by `data-title`

mixer.sort('published-date:desc data-title:asc')
.then(function(state) {
console.log(state.activeSort.attribute === 'published-date'); // true
console.log(state.activeSort.order === 'desc'); // true

console.log(state.activeSort.next.attribute === 'title'); // true
console.log(state.activeSort.next.order === 'asc'); // true
});

@example <caption>Example 4: Sorting by random</caption>

mixer.sort('random')
.then(function(state) {
console.log(state.activeSort.order === 'random') // true
});

@example <caption>Example 5: Sorting via an element collection</caption>

var collection = Array.from(container.querySelectorAll('.mix'));

// Swap the position of two elements in the collection:

var temp = collection[1];

collection[1] = collection[0];
collection[0] = temp;

// Pass the sorted collection to MixItUp

mixer.sort(collection)
.then(function(state) {
console.log(state.targets[0] === collection[0]); // true
});

@public
@instance
@since       2.0.0
@param       {(string|Array.<HTMLElement>)}    sortString
A valid sort string (e.g. `'default'`, `'published-date:asc'`, or `'random'`). The sort method also accepts an array of all target elements in a user-defined order.
@param       {boolean}   [animate=true]
An optional boolean dictating whether the operation should animate, or occur syncronously with no animation. `true` by default.
@param       {function}  [callback=null]
An optional callback function to be invoked after the operation has completed.
@return      {Promise.<mixitup.State>}
A promise resolving with the current state object.
Sorts all targets in the container according to a provided sort string .