-
Notifications
You must be signed in to change notification settings - Fork 723
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allows to bind "reach top" callback. #174
base: master
Are you sure you want to change the base?
Conversation
Could be considered as pre requirements for sroze#146.
+1 |
Do you have an example of this functional anywhere that is publicly accessible? |
@boushley Facebook chat. edit: Maybe I misunderstood you, you might've meant this specific PR? |
Facebook chat is using react js isn't it? I'm not asking for an example of the concept in action. I'm asking for an example of this pull request being used, or a demo of this code. The scroll top stuff appears to only work when |
@@ -49,7 +52,7 @@ mod.directive('infiniteScroll', [ | |||
} | |||
}; | |||
handler = function() { | |||
var containerBottom, containerTopOffset, elementBottom, remaining, shouldScroll; | |||
var containerBottom, containerTopOffset, elementBottom, remaining, remainingTop, shouldScroll, shouldScrollTop; | |||
if (container === windowElement) { | |||
containerBottom = height(container) + pageYOffset(container[0].document.documentElement); | |||
elementBottom = offsetTop(elem) + height(elem); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you add containerTopOffset = container.scrollTop();
then this works against the window container as well.
Check this http://jsbin.com/xemeletuwi/1/edit?html,js,console,output but this is quite buggy. When I tested it I found out that there is no way to get height before and after prepend items without timeout because my example uses ng-repeat. The solution relies on digest cycle which is slow and you could see that even if you set timeout to small value it shows UI in previous state. |
http://jsbin.com/qoqahijene/3/edit |
extended with shouldScrollTop = false
fix for top handler when container not visible
21036ac
to
79473ca
Compare
Could be considered as pre requirements for #146
DOESN'T: