Skip to content

Commit

Permalink
Increment version, repeat scroll until filled, missing brackets
Browse files Browse the repository at this point in the history
  • Loading branch information
OlduwanSteve committed Jun 25, 2014
1 parent 31aa0cc commit 5c067d0
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
5 changes: 3 additions & 2 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.2 - 2014-05-21 */
/* ng-infinite-scroll - v1.1.2 - 2014-06-25 */
var mod;

mod = angular.module('infinite-scroll', []);
Expand Down Expand Up @@ -41,10 +41,11 @@ mod.directive('infiniteScroll', [
elementBottom = $(document).height();
}
remaining = elementBottom - containerBottom;
shouldScroll = remaining <= container.height() * scrollDistance + 1;
shouldScroll = remaining <= container.height() * (scrollDistance + 1);
if (shouldScroll) {
checkWhenEnabled = true;
if (scrollEnabled) {
$timeout((function() {}, handler()), 0);
if (scope.$$phase || $rootScope.$$phase) {
return scope.infiniteScroll();
} else {
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.

4 changes: 2 additions & 2 deletions component.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "nginfinitescroll",
"repo": "sroze/nginfinitescroll",
"repo": "olduwansteve/nginfinitescroll",
"description": "Infinite scrolling for AngularJS",
"version": "1.1.3",
"version": "1.1.4",
"keywords": ["scroll", "infinite", "angular", "angularjs"],
"scripts": ["build/ng-infinite-scroll.min.js"],
"dependencies":{},
Expand Down
6 changes: 5 additions & 1 deletion src/infinite-scroll.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,16 @@ mod.directive 'infiniteScroll', ['$rootScope', '$window', '$timeout', 'THROTTLE_
elementBottom = $(document).height()

remaining = elementBottom - containerBottom
shouldScroll = remaining <= container.height() * scrollDistance + 1
shouldScroll = remaining <= container.height() * (scrollDistance + 1)

if shouldScroll
checkWhenEnabled = true

if scrollEnabled
# Always schedule another check to see if the container is full after the call
$timeout (->
handler()
), 0
if scope.$$phase || $rootScope.$$phase
scope.infiniteScroll()
else
Expand Down

0 comments on commit 5c067d0

Please sign in to comment.