docs/vendor/mixitup/mixitup.js
function() {
            var self        = this,
                operation   = null,
                animate     = false,
                queueItem   = null,
                instruction = self.parseMultimixArgs(arguments);

            self.callActions('beforeMultimix', arguments);

            if (!self.isBusy) {
                operation = self.getOperation(instruction.command);

                if (self.config.controls.enable) {
                    // Update controls for API calls

                    if (instruction.command.filter && !self.isToggling) {
                        // As we are not toggling, reset the toggle array
                        // so new filter overrides existing toggles

                        self.toggleArray.length = 0;
                        self.buildToggleArray(operation.command);
                    }

                    if (self.queue.length < 1) {
                        self.updateControls(operation.command);
                    }
                }

                if (instruction.callback) self.userCallback = instruction.callback;

                // Always allow the instruction to override the instance setting

                animate = (instruction.animate ^ self.config.animation.enable) ?
                    instruction.animate :
                    self.config.animation.enable;

                self.callFilters('operationMultimix', operation, arguments);

                return self.goMix(animate, operation);
            } else {
                queueItem = new mixitup.QueueItem();

                queueItem.args           = arguments;
                queueItem.instruction    = instruction;
                queueItem.triggerElement = self.lastClicked;
                queueItem.isToggling     = self.isToggling;

                return self.queueMix(queueItem);
            }
        }
function() {
            var self        = this,
                operation   = null,
                animate     = false,
                queueItem   = null,
                instruction = self.parseMultimixArgs(arguments);

            self.callActions('beforeMultimix', arguments);

            if (!self.isBusy) {
                operation = self.getOperation(instruction.command);

                if (self.config.controls.enable) {
                    // Update controls for API calls

                    if (instruction.command.filter && !self.isToggling) {
                        // As we are not toggling, reset the toggle array
                        // so new filter overrides existing toggles

                        self.toggleArray.length = 0;
                        self.buildToggleArray(operation.command);
                    }

                    if (self.queue.length < 1) {
                        self.updateControls(operation.command);
                    }
                }

                if (instruction.callback) self.userCallback = instruction.callback;

                // Always allow the instruction to override the instance setting

                animate = (instruction.animate ^ self.config.animation.enable) ?
                    instruction.animate :
                    self.config.animation.enable;

                self.callFilters('operationMultimix', operation, arguments);

                return self.goMix(animate, operation);
            } else {
                queueItem = new mixitup.QueueItem();

                queueItem.args           = arguments;
                queueItem.instruction    = instruction;
                queueItem.triggerElement = self.lastClicked;
                queueItem.isToggling     = self.isToggling;

                return self.queueMix(queueItem);
            }
        }
function ( ) { var self = this , operation = null , animate = false , queueItem = null , instruction = self . parseMultimixArgs ( arguments ) ; self . callActions ( 'beforeMultimix' , arguments ) ; if ( ! self . isBusy ) { operation = self . getOperation ( instruction . command ) ; if ( self . config . controls . enable ) { // Update controls for API calls if ( instruction . command . filter && ! self . isToggling ) { // As we are not toggling, reset the toggle array // so new filter overrides existing toggles self . toggleArray . length = 0 ; self . buildToggleArray ( operation . command ) ; } if ( self . queue . length < 1 ) { self . updateControls ( operation . command ) ; } } if ( instruction . callback ) self . userCallback = instruction . callback ; // Always allow the instruction to override the instance setting animate = ( instruction . animate ^ self . config . animation . enable ) ? instruction . animate : self . config . animation . enable ; self . callFilters ( 'operationMultimix' , operation , arguments ) ; return self . goMix ( animate , operation ) ; } else { queueItem = new mixitup . QueueItem ( ) ; queueItem . args = arguments ; queueItem . instruction = instruction ; queueItem . triggerElement = self . lastClicked ; queueItem . isToggling = self . isToggling ; return self . queueMix ( queueItem ) ; } }
Performs simultaneous `filter`, `sort`, `insert`, `remove` and `changeLayout`
operations as requested.

@example

.multimix(multimixCommand [, animate] [, callback])

@example <caption>Example 1: Performing simultaneous filtering and sorting</caption>

mixer.multimix({
filter: '.category-b',
sort: 'published-date:desc'
})
.then(function(state) {
console.log(state.activeFilter.selector === '.category-b'); // true
console.log(state.activeSort.attribute === 'published-date'); // true
});

@example <caption>Example 2: Performing simultaneous sorting, insertion, and removal</caption>

console.log(mixer.getState().totalShow); // 6

// NB: When inserting via `multimix()`, an object should be provided as the value
// for the `insert` portion of the command, allowing for a collection of elements
// and an insertion index to be specified.

mixer.multimix({
sort: 'published-date:desc', // Sort the container, including any new elements
insert: {
collection: [newElementReferenceA, newElementReferenceB], // Add 2 new elements at index 5
index: 5
},
remove: existingElementReference // Remove 1 existing element
})
.then(function(state) {
console.log(state.activeSort.attribute === 'published-date'); // true
console.log(state.totalShow === 7); // true
});

@public
@instance
@since       2.0.0
@param       {object}    multimixCommand
An object containing one or more things to do
@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.
Performs simultaneous filter sort insert remove and changeLayout operations as requested .