From 60cc0241b3342b4e0f4ff98a6600ec0af959fe54 Mon Sep 17 00:00:00 2001 From: Glen Cheney Date: Fri, 15 Apr 2016 17:42:48 -0700 Subject: [PATCH] Docs updates. Remove LOADING and DONE events. --- _config.yml | 1 - _includes/events.html | 25 +-- _includes/features.html | 3 +- _includes/head.html | 2 + _includes/options.html | 17 +- _includes/usage.html | 68 +++---- _posts/2013-05-01-basic.html | 4 +- _posts/2013-05-03-images.html | 18 +- _posts/2013-06-29-image-problems.html | 10 +- _posts/2013-08-25-animated.html | 4 +- _posts/2014-03-08-bootstrap3-grid.html | 4 +- _posts/2014-04-09-requirejs.html | 24 ++- _scss/_grid.scss | 4 + _scss/shuffle-styles.scss | 4 +- css/shuffle-styles.css | 4 +- css/style.css | 6 +- dist/shuffle.js | 58 +++--- dist/shuffle.min.js | 2 +- index.html | 12 +- js/demos/animate-in.js | 2 +- js/demos/homepage.js | 4 +- js/demos/images.js | 2 +- js/demos/padding-grid.js | 2 +- src/on-transition-end.js | 2 +- src/shuffle.es6.js | 56 +++-- test/test.js | 272 +++++++++++-------------- 26 files changed, 286 insertions(+), 324 deletions(-) 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