-
-
Notifications
You must be signed in to change notification settings - Fork 131
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
Implemented triggerOffset property. #87
Implemented triggerOffset property. #87
Conversation
Really nice, you're the man! Though it looks like the build is failing, do you know what's the issue there? CheeriO |
Thanks! :) |
Hehe, good ol "works for me" :) |
I would like to explore using https://github.com/dockyard/ember-in-viewport for viewport checking - it has offsets & tolerance and everything we need. What do u think @mariuszzak ? |
else { | ||
selfOffset = this.$().offset().top; | ||
} | ||
return selfOffset; |
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.
more of a stylistic point, but you could write this as
if(this.get('_customScrollableIsDefined')) {
return this.$().position().top + this.get("_scrollable").scrollTop();
}
else {
return this.$().offset().top;
}
or even
return this.get('_customScrollableIsDefined')) ?
this.$().position().top + this.get("_scrollable").scrollTop() :
this.$().offset().top;
ur the man mike! Happy to put the move to ember-in-viewport as work for after we get this in! |
deac29e
to
99da005
Compare
I apologize for the long absence of answers. @hhff I think it's not worth to couple this plugin with @mike-north Thanks a lot for code review! Fixes are ready. Is there any possibility to get rid of the code duplication? postList = find('ul');
infinityLoader = find('.infinity-loader');
triggerOffset = postList.get(0).scrollHeight - postList.height(); |
triggerOffset=500 | ||
scrollable=".demo-items" | ||
}} | ||
</ul> |
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.
please observe proper HTML indentation
The same spec's failures are on master branch currently. New release of ember-beta brought some changes. Any idea? |
Looks like we're going to have to move the infinity-loader unit tests to integration tests |
Tests seem to be ok now. Is there anything I should refine? |
👍 LGTM - @davidgoli / @kellyselden wanna give this a final gaze? |
if(this.get('developmentMode')) { | ||
return false; | ||
} | ||
return this._bottomOfScrollableOffset() > this._triggerOffset(); |
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.
I'd just reformat this to use more whitespace, like so:
if (this.get('developmentMode')) {
return false;
}
return this._bottomOfScrollableOffset() > this._triggerOffset();
Nice work |
Just a few formatting comments but this looks solid... thanks for all the tests! |
👍 what @davidgoli said - amazing work @mariuszzak - very very keen to land this ! |
Thanks a lot guys! I'm gonna improve code ASAP. |
d0872ec
to
cc4150c
Compare
Cosmetic improvements are finished. @davidgoli thanks again for comments! 💯 |
Nice! I would say let's squash to a single commit and then we're ready to merge! |
cc4150c
to
6698175
Compare
Ok, done :) |
Implemented triggerOffset property.
I have implemented triggerOffset property which let you adjust starting loading more items before the scroll is on the very bottom of window (or scrollable div). I've also resolved problem described here: #82. Now the trigger in scrollable divs works properly :)