Skip to content

Commit

Permalink
Add window check
Browse files Browse the repository at this point in the history
  • Loading branch information
dbrekalo committed Sep 9, 2019
1 parent 0f2bb86 commit 43c28c8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
6 changes: 4 additions & 2 deletions dist/whenInViewport.js
Original file line number Diff line number Diff line change
Expand Up @@ -299,8 +299,10 @@

};

var $ = window.jQuery || window.$;
$ && WhenInViewport.registerAsJqueryPlugin($);
if (typeof window !== 'undefined') {
var $ = window.jQuery || window.$;
$ && WhenInViewport.registerAsJqueryPlugin($);
}

return WhenInViewport;

Expand Down
2 changes: 1 addition & 1 deletion dist/whenInViewport.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions src/whenInViewport.js
Original file line number Diff line number Diff line change
Expand Up @@ -299,8 +299,10 @@

};

var $ = window.jQuery || window.$;
$ && WhenInViewport.registerAsJqueryPlugin($);
if (typeof window !== 'undefined') {
var $ = window.jQuery || window.$;
$ && WhenInViewport.registerAsJqueryPlugin($);
}

return WhenInViewport;

Expand Down

0 comments on commit 43c28c8

Please sign in to comment.