Skip to content

Commit

Permalink
update version
Browse files Browse the repository at this point in the history
  • Loading branch information
anavicente committed Sep 4, 2019
1 parent 528ff6c commit 0a3f565
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "peekaboo",
"version": "1.0.0",
"version": "1.0.2",
"description": "JavaScript helper for viewport based CSS animations",
"main": "dist/peekaboo.min.js",
"repository": {
Expand Down
16 changes: 12 additions & 4 deletions src/peekaboo.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* JavaScript helper for viewport based CSS animations
* @version v1.0
* @version v1.0.2
* @author Ana Vicente
* @copyright ©2018 Ana Vicente
* Released under the MIT license
Expand Down Expand Up @@ -49,7 +49,10 @@
threshold: this.options.threshold,
};

var observer = new IntersectionObserver(this.observeItem.bind(this), options);
var observer = new IntersectionObserver(
this.observeItem.bind(this),
options
);

for (var i = 0; i < this.items.length; i++) {
observer.observe(this.items[i]);
Expand All @@ -61,7 +64,10 @@
var entry = entries[i],
item = entry.target;

if (entry.intersectionRatio > this.options.threshold && !this.isPeekabooed(item)) {
if (
entry.intersectionRatio > this.options.threshold &&
!this.isPeekabooed(item)
) {
this.animItem(item);

observer.unobserve(item);
Expand All @@ -84,7 +90,9 @@
};

PK.animItem = function(item) {
var delay = item.getAttribute('data-peekaboo-delay') ? item.getAttribute('data-peekaboo-delay') : 0;
var delay = item.getAttribute('data-peekaboo-delay')
? item.getAttribute('data-peekaboo-delay')
: 0;
var _this = this;

this.peekabooed.push(item);
Expand Down

0 comments on commit 0a3f565

Please sign in to comment.