Skip to content
This repository has been archived by the owner on Oct 30, 2024. It is now read-only.

Commit

Permalink
fully document sort api method
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Kunka committed Dec 8, 2016
1 parent 3b03e7d commit 8f322f4
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 9 deletions.
2 changes: 1 addition & 1 deletion demos/mixitup.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 22 additions & 4 deletions dist/mixitup.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**!
* MixItUp v3.0.0-beta
* A high-performance, dependency-free library for animated filtering, sorting and more
* Build f52f3ec0-2620-4eef-b696-36b09c0d3b4a
* Build 6b06fe81-4ea9-43cd-95ec-e53682227df3
*
* @copyright Copyright 2014-2016 KunkaLabs Limited.
* @author KunkaLabs Limited.
Expand Down Expand Up @@ -7812,7 +7812,7 @@
* @instance
* @since 2.0.0
* @param {(string|HTMLElement|Array.<HTMLElement>|mixitup.CommandFilter)} selector
* Any valid CSS selector (i.e. `'.category-a'`), or the values `'all'` or `'none'`. The filter function also accepts a reference to single target element or a collection of target elements to show.
* Any valid CSS selector (i.e. `'.category-a'`), or the values `'all'` or `'none'`. The filter method also accepts a reference to single target element or a collection of target elements to show.
* @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]
Expand Down Expand Up @@ -7972,11 +7972,29 @@
* 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} sortString
* A valid sort string (e.g. `'default'`, `'published-date:asc'`, or `'random'`).
* @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]
Expand Down
2 changes: 1 addition & 1 deletion dist/mixitup.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 21 additions & 3 deletions src/mixer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2985,7 +2985,7 @@ h.extend(mixitup.Mixer.prototype,
* @instance
* @since 2.0.0
* @param {(string|HTMLElement|Array.<HTMLElement>|mixitup.CommandFilter)} selector
* Any valid CSS selector (i.e. `'.category-a'`), or the values `'all'` or `'none'`. The filter function also accepts a reference to single target element or a collection of target elements to show.
* Any valid CSS selector (i.e. `'.category-a'`), or the values `'all'` or `'none'`. The filter method also accepts a reference to single target element or a collection of target elements to show.
* @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]
Expand Down Expand Up @@ -3145,11 +3145,29 @@ h.extend(mixitup.Mixer.prototype,
* 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} sortString
* A valid sort string (e.g. `'default'`, `'published-date:asc'`, or `'random'`).
* @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]
Expand Down

0 comments on commit 8f322f4

Please sign in to comment.