Skip to content

Commit

Permalink
Release 1.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
sroze committed May 14, 2014
1 parent 1a6ccd0 commit ed47881
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 12 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ngInfiniteScroll",
"version": "1.1.0",
"version": "1.1.1",
"main": "build/ng-infinite-scroll.js",
"dependencies": {
"angular": ">=1.1.3"
Expand Down
27 changes: 19 additions & 8 deletions build/ng-infinite-scroll.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* ng-infinite-scroll - v1.1.0 - 2014-04-03 */
/* ng-infinite-scroll - v1.1.1 - 2014-05-14 */
var mod;

mod = angular.module('infinite-scroll', []);
Expand All @@ -23,20 +23,31 @@ mod.directive('infiniteScroll', [
container = null;
immediateCheck = true;
handler = function() {
var containerBottom, elementBottom, remaining, shouldScroll;
var containerBottom, containerTopOffset, elementBottom, remaining, shouldScroll;
if (container === $window) {
containerBottom = container.height() + container.scrollTop();
elementBottom = elem.offset().top + elem.height();
} else {
containerBottom = container.height();
elementBottom = elem.offset().top - container.offset().top + elem.height();
containerTopOffset = 0;
if (container.offset() !== void 0) {
containerTopOffset = container.offset().top;
}
elementBottom = elem.offset().top - containerTopOffset + elem.height();
}
remaining = elementBottom - containerBottom;
shouldScroll = remaining <= container.height() * scrollDistance + 1;
if (shouldScroll && scrollEnabled) {
return scope.infiniteScroll();
} else if (shouldScroll) {
return checkWhenEnabled = true;
if (shouldScroll) {
checkWhenEnabled = true;
if (scrollEnabled) {
if (scope.$$phase || $rootScope.$$phase) {
return scope.infiniteScroll();
} else {
return scope.$apply(scope.infiniteScroll);
}
}
} else {
return checkWhenEnabled = false;
}
};
throttle = function(func, wait) {
Expand Down Expand Up @@ -92,7 +103,7 @@ mod.directive('infiniteScroll', [
if (container != null) {
container.off('scroll', handler);
}
container = newContainer;
container = typeof newContainer.last === 'function' ? newContainer.last() : newContainer;
if (newContainer != null) {
return container.on('scroll', handler);
}
Expand Down
4 changes: 2 additions & 2 deletions build/ng-infinite-scroll.min.js

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ng-infinite-scroll",
"version": "1.1.0",
"version": "1.1.1",
"description": "Infinite scrolling for AngularJS",
"repository": {
"type": "git",
Expand Down

0 comments on commit ed47881

Please sign in to comment.