Skip to content

Commit

Permalink
Merge pull request #19 from creativelive/commonjs-support
Browse files Browse the repository at this point in the history
Commonjs support
  • Loading branch information
JustinBeaudry authored Jun 15, 2018
2 parents 18a61d7 + 6bc3cc5 commit 864ce1c
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 11 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
node_modules
.gh-pages
.idea
.DS_STORE
npm-debug.log
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: node_js
node_js:
- "0.10"
- "4.8.6"
env:
global:
- GH_REF: github.com/creativelive/appear.git
Expand All @@ -12,7 +12,7 @@ after_success:
- touch .nojekyll
- git init
- git config user.name "cl-bender"
- git config user.email "matthew.hadley+[email protected]"
- git config user.email "[email protected]"
- git add .
- git commit -m "build gh-pages"
- git push --force --quiet "https://${GH_TOKEN}@${GH_REF}" master:gh-pages
Expand Down
12 changes: 9 additions & 3 deletions dist/appear.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* appear.js 1.1.0 */
appear = (function(){
(function(window){
'use strict';
var scrollLastPos = null, scrollTimer = 0, scroll = {};

Expand Down Expand Up @@ -173,7 +173,7 @@ appear = (function(){
}
}

return function(obj) {
var appear = function(obj) {
obj = obj || {};

// assign the fn to execute when a node is visible
Expand Down Expand Up @@ -244,6 +244,12 @@ appear = (function(){
};

};

if (typeof module !== 'undefined' && typeof module.exports !== 'undefined') {
module.exports = appear;
} else {
window.appear = appear;
}
}()(obj));
};
}());
}(this));
2 changes: 1 addition & 1 deletion dist/appear.min.js

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

12 changes: 9 additions & 3 deletions lib/appear.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
appear = (function(){
(function(window){
'use strict';
var scrollLastPos = null, scrollTimer = 0, scroll = {};

Expand Down Expand Up @@ -172,7 +172,7 @@ appear = (function(){
}
}

return function(obj) {
var appear = function(obj) {
obj = obj || {};

// assign the fn to execute when a node is visible
Expand Down Expand Up @@ -243,6 +243,12 @@ appear = (function(){
};

};

if (typeof module !== 'undefined' && typeof module.exports !== 'undefined') {
module.exports = appear;
} else {
window.appear = appear;
}
}()(obj));
};
}());
}(this));
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "appear",
"version": "1.1.0",
"version": "1.2.0",
"description": "utility to run functions when dom elements are visible",
"kewords": "detect viewable elements dom lazy load scroll ",
"main": "appear.js",
Expand Down Expand Up @@ -34,5 +34,5 @@
"bugs": {
"url": "https://github.com/creativelive/appear/issues"
},
"homepage": "https://github.com/creativelive/appear"
"homepage": "http://creativelive.github.io/appear/"
}

0 comments on commit 864ce1c

Please sign in to comment.