Permalink
Browse files

Updated docs and travis.yml file.

  • Loading branch information...
1 parent aafa8f2 commit 43a4f6d6b1a38144723c0c40ceaa15df477208a8 @niklasramo niklasramo committed Jan 4, 2017
Showing with 41 additions and 37 deletions.
  1. +4 −3 .travis.yml
  2. +36 −34 README.md
  3. +1 −0 website
View
@@ -1,7 +1,8 @@
language: node_js
node_js:
- - "4"
+ - "6"
env:
global:
- - secure: VUU14zf9WKf/lRHKJInITvdvgppXDgrM0UYSxe3EvO5ElQKCivB/lHddIIUA8mdwQz5i5GCizrePssLr1OR0dfF98s33pYIuN4Enrpkyq7X90pKr7ru3ZrwrqLH2PC5U6ta4GppVsrgFYmRHpuwhGlm0Fpf0obGweTGXwsZtCBQ=
- - secure: lsrw8vXXY6eOHxEGh3oB57zEtUlw1tt0CnJ8PLRGb2twumDpzKeeAKXSJjvbb13csGZvJbesOgpufdXtFIoT9LraGLA14xBBS7xVTPuhr0NCEC/MEpsXVvNkS10Vd+VsEtNMvPpMe4a0vRkNge+IlhQY4pRpnME14kaniF9BiCE=
+ - secure: bDVeC8Sy6fC7OOG+Q27G2aZ6Yjcn5s3A+5ZgNQbpnV46Dq7+9nP+69KqtHsfUaDiunDA6n6CdvOXdWNG66nHMUE36nZg13h+mRHHxKehXcJN1QAbY9ZEXplCeAXDlTAsO54H3R9Cp8OmRMNtUC47MgygkmZqDDud+3iMyFqT+9U=
+ - secure: lzqfZleLwkf8OHvADsLidmOY0l1yQZZ0iqEn2XI5/pgBwfUbEXp00ysvhy6/+wbcpn7Y7lM9q955V1b0igYQ9Z8mY3KvdSsNfvF/HZFkgLNuaMaYZ2tCKUjdL5gI8N5yYW3e91EoDnQs8B9alqTnwuwilqVjz2SUuZBe50i/loE=
+ email: false
View
@@ -135,7 +135,9 @@ An important note for including Muuri to your site is that it needs to have acce
```javascript
var grid = new Muuri({
container: document.getElementsByClassName('grid')[0],
- items: document.getElementsByClassName('item')
+ // Muuri does not convert a node list to array automatically
+ // so we have to do it manually.
+ items: [].slice.call(document.getElementsByClassName('item'))
});
```
@@ -145,7 +147,7 @@ var grid = new Muuri({
* Default value: `null`.
* The container element. Must be always defined.
* **`items`**  —  *array of elements*
- * Default value: `null`.
+ * Default value: `[]`.
* The initial item elements wrapped in an array. The elements must be children of the container element.
* **`positionDuration`**  —  *number*
* Default value: `300`.
@@ -183,32 +185,32 @@ var grid = new Muuri({
* **`dragEnabled`**  —  *boolean*
* Default value: `false`.
* Should items be draggable?
+* **`dragContainer`**  —  *null / element*
+ * Default value: `null`.
+ * Which item should the dragged item be appended to for the duration of the drag? If `null` is provided the item's muuri container element will be used.
* **`dragPredicate`**  —  *null / function*
* Default value: `null`.
* A function that determines when dragging should start. Set to null to use the default predicate.
* **`dragSort`**  —  *boolean*
* Default value: `true`.
* Should the items be sorted during drag?
-* **`dragContainer`**  —  *null / element*
- * Default value: `null`.
- * Which item should the dragged item be appended to for the duration of the drag? If `null` is provided the item's muuri container element will be used.
-* **`dragReleaseDuration`**  —  *number*
- * Default value: `300`.
- * The duration for item's drag release animation. Set to `0` to disable.
-* **`dragReleaseEasing`**  —  *string / array*
- * Default value: `"ease-out"`.
- * The easing for item's drag release animation. Read [Velocity's easing documentation](http://julian.com/research/velocity/#easing) for more info on possible easing values.
-* **`dragOverlapInterval`**  —  *number*
+* **`dragSortInterval`**  —  *number*
* Default value: `50`.
- * When an item is dragged around the grid Muuri automatically checks if the item overlaps another item enough to move the item in it's place. The overlap check method is debounced and this option defines the debounce interval in milliseconds. In other words, this is option defines the amount of time the dragged item must be still before an overlap is checked.
-* **`dragOverlapTolerance`**  —  *number*
+ * When an item is dragged around the grid Muuri automatically checks if the item overlaps another item enough to move the item in it's place. The overlap check method is debounced and this option defines the debounce interval in milliseconds. In other words, this is option defines the amount of time the dragged item must be still before the overlap is checked.
+* **`dragSortTolerance`**  —  *number*
* Default value: `50`.
* Allowed values: `1` - `100`.
- * How many percent the intersection area between the dragged item and the compared item should be from the maximum potential intersection area between the two items in order to justify for the dragged item's replacement.
-* **`dragOverlapAction`**  —  *string*
+ * How many percent the intersection area between the dragged item and the compared item should be from the maximum potential intersection area between the two items in order to justify for sorting to occur.
+* **`dragSortAction`**  —  *string*
* Default value: `"move"`.
* Allowed values: `"move"`, `"swap"`.
* Should the dragged item be *moved* to the new position or should it *swap* places with the item it overlaps?
+* **`dragReleaseDuration`**  —  *number*
+ * Default value: `300`.
+ * The duration for item's drag release animation. Set to `0` to disable.
+* **`dragReleaseEasing`**  —  *string / array*
+ * Default value: `"ease-out"`.
+ * The easing for item's drag release animation. Read [Velocity's easing documentation](http://julian.com/research/velocity/#easing) for more info on possible easing values.
* **`containerClass`**  —  *string*
* Default value: `"muuri"`.
* Container element classname.
@@ -236,8 +238,8 @@ var grid = new Muuri({
The default settings are stored in `Muuri.defaultSettings` object.
```javascript
-Muuri.defaultSettings.containerDuration = 400;
-Muuri.defaultSettings.dragOverlapAction = 'swap';
+Muuri.defaultSettings.positionDuration = 400;
+Muuri.defaultSettings.dragSortAction = 'swap';
```
**Quick reference**
@@ -268,14 +270,14 @@ var defaults = {
// Drag & Drop
dragEnabled: false,
+ dragContainer: null,
dragPredicate: null,
dragSort: true,
- dragContainer: null,
+ dragSortInterval: 50,
+ dragSortTolerance: 50,
+ dragSortAction: 'move',
dragReleaseDuration: 300,
dragReleaseEasing: 'ease-out',
- dragOverlapInterval: 50,
- dragOverlapTolerance: 50,
- dragOverlapAction: 'move',
// Classnames
containerClass: 'muuri',
@@ -314,7 +316,7 @@ muuri.on('layoutend', function (items) {
 
-### `muuri.off( eventName, listener )`
+### `muuri.off( event, listener )`
Unbind an event from the Muuri instance.
@@ -751,7 +753,7 @@ Triggered when `muuri.show()` method is called, after the items are shown (with
**Listener parameters**
* **items**  —  *array*
- * An array of `Muuri.Item` instances that were succesfully shown without interruptions. If an item is already visible when the `muuri.show()` method is called it is cosidered as successfully shown.
+ * An array of `Muuri.Item` instances that were succesfully shown without interruptions. If an item is already visible when the `muuri.show()` method is called it is considered as successfully shown.
**Examples**
@@ -785,7 +787,7 @@ Triggered when `muuri.hide()` method is called, after the items are hidden (with
**Listener parameters**
* **items**  —  *array*
- * An array of `Muuri.Item` instances that were succesfully hidden without interruptions. If an item is already hidden when the `muuri.show()` method is called it is cosidered as successfully hidden.
+ * An array of `Muuri.Item` instances that were succesfully hidden without interruptions. If an item is already hidden when the `muuri.hide()` method is called it is considered as successfully hidden.
**Examples**
@@ -801,9 +803,9 @@ Triggered after `muuri.move()` method is called.
**Listener parameters**
-* **targetFrom**  —  *array*
+* **targetFrom**  —  *Muuri.Item*
* `Muuri.Item` instance that was moved.
-* **targetTo**  —  *array*
+* **targetTo**  —  *Muuri.Item*
* `Muuri.Item` instance to which's index the *targetFrom* item was moved to.
**Examples**
@@ -821,15 +823,15 @@ Triggered after `muuri.swap()` method is called.
**Listener parameters**
-* **targetA**  —  *array*
+* **targetA**  —  *Muuri.Item*
* `Muuri.Item` instance that was swapped with *targetB*.
-* **targetB**  —  *array*
+* **targetB**  —  *Muuri.Item*
* `Muuri.Item` instance that was swapped with *targetA*.
**Examples**
```javascript
-muuri.on('move', function (targetA, targetB) {
+muuri.on('swap', function (targetA, targetB) {
console.log(targetA);
console.log(targetB);
});
@@ -878,7 +880,7 @@ Triggered when dragging of an item begins.
* **item**  —  *Muuri.Item*
* `Muuri.Item` instance that is being dragged.
* **data**  —  *object*
- * **data.type**  —  *String*
+ * **data.type**  —  *string*
* `"dragstart"`
* **data.event**  —  *object*
* The hammer event for the drag start event.
@@ -909,7 +911,7 @@ Triggered when an item is dragged.
* **item**  —  *Muuri.Item*
* `Muuri.Item` instance that is being dragged.
* **data**  —  *object*
- * **data.type**  —  *String*
+ * **data.type**  —  *string*
* `"dragmove"`
* **data.event**  —  *object*
* The hammer event for the drag start event.
@@ -940,7 +942,7 @@ Triggered when any of the scroll parents of a dragged item is scrolled.
* **item**  —  *Muuri.Item*
* `Muuri.Item` instance that is being dragged.
* **data**  —  *object*
- * **data.type**  —  *String*
+ * **data.type**  —  *string*
* `"dragscroll"`
* **data.event**  —  *object*
* Th scroll event.
@@ -971,7 +973,7 @@ Triggered after item dragging ends.
* **item**  —  *Muuri.Item*
* `Muuri.Item` instance that is being dragged.
* **data**  —  *object*
- * **data.type**  —  *String*
+ * **data.type**  —  *string*
* `"dragend"`
* **data.event**  —  *object*
* The hammer event for the drag start event.
Submodule website added at 191cbd

0 comments on commit 43a4f6d

Please sign in to comment.