Skip to content

Commit

Permalink
Merge branch 'release/0.2.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
poteto committed Apr 17, 2015
2 parents 335a412 + 790a988 commit 6e3cbd8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ This `ember-cli` addon adds a simple, highly performant Ember Mixin to your app.

This software will not be ready for production use until `1.0.0`.

## Demo
- App: http://development.ember-in-viewport-demo.divshot.io/
- Source: https://github.com/poteto/ember-in-viewport-demo

## Usage
Usage is simple. First, add the mixin to your `Component`:

Expand Down Expand Up @@ -54,6 +58,12 @@ export default Ember.Component.extend(InViewportMixin, {
});
```

- `viewportUseRAF: boolean`

Default: Depends on browser

As it's name suggests, if this is `true`, the mixin will use `requestAnimationFrame` instead of the Ember run loop. Unless you want to force enabling or disabling this, you won't need to override this option.

- `viewportSpy: boolean`

Default: `false`
Expand Down
4 changes: 2 additions & 2 deletions addon/utils/is-in-viewport.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ export default function isInViewport(boundingClientRect={}, height=0, width=0, t
} = tolerances;

return (
(top - topTolerance) >= 0 &&
(left - leftTolerance) >= 0 &&
(top + topTolerance) >= 0 &&
(left + leftTolerance) >= 0 &&
(bottom - bottomTolerance) <= height &&
(right - rightTolerance) <= width
);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ember-in-viewport",
"version": "0.2.0",
"version": "0.2.1",
"description": "Detect if an Ember View or Component is in the viewport @ 60FPS",
"directories": {
"doc": "doc",
Expand Down

0 comments on commit 6e3cbd8

Please sign in to comment.