diff --git a/_config.yml b/_config.yml index e1720bd..cd9f6fd 100644 --- a/_config.yml +++ b/_config.yml @@ -13,7 +13,6 @@ exclude: [ 'bower.json', 'CONTRIBUTING.md', 'gulpfile.js', - 'package.json', 'README.md', 'webpack.config.js', 'webpack.config.min.js' diff --git a/_includes/events.html b/_includes/events.html index 64dfa06..0ad51dc 100644 --- a/_includes/events.html +++ b/_includes/events.html @@ -1,27 +1,20 @@

Events

-

A list of events shuffle triggers:

- +

Shuffle emits an event when a layout happens and when elements are removed. The event names are Shuffle.EventType.LAYOUT and Shuffle.EventType.REMOVED.

+

Shuffle uses the global CustomEvent to create events. A polyfill for IE<=11 is bundled with Shuffle.

-

Get notified when shuffle is done with setup

+

Get notified when a layout happens

-
$grid.on('done.shuffle', function() {
-  console.log('Finished initializing shuffle!');
-});
-
-// Initialize shuffle
-$grid.shuffle( options );
+
element.addEventListener(Shuffle.EventType.LAYOUT, function () {
+  console.log('Things finished moving!');
+});

Do something when an item is removed

-
$grid.on('removed.shuffle', function( evt, $collection, shuffle ) {
-  console.log( this, evt, $collection, shuffle );
+  
element.addEventListener(Shuffle.EventType.REMOVED, function (evt) {
+  var detail = evt.detail;
+  console.log(this, evt, detail.collection, detail.shuffle);
 });
diff --git a/_includes/features.html b/_includes/features.html index 426a5f3..536ea8d 100644 --- a/_includes/features.html +++ b/_includes/features.html @@ -1,8 +1,7 @@

Features