Skip to content
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

Merged

Conversation

mariuszzak
Copy link

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 :)

@mariuszzak mariuszzak changed the title Implemented triggerOffset param. Implemented triggerOffset property. Sep 6, 2015
@ghost
Copy link

ghost commented Sep 6, 2015

Really nice, you're the man!

Though it looks like the build is failing, do you know what's the issue there?

CheeriO

@mariuszzak
Copy link
Author

Thanks! :)
I'm trying to find the problem. On my local environment tests pass properly.

@ghost
Copy link

ghost commented Sep 6, 2015

Hehe, good ol "works for me" :)

@hhff
Copy link
Collaborator

hhff commented Sep 6, 2015

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;
Copy link
Collaborator

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;

@hhff
Copy link
Collaborator

hhff commented Sep 7, 2015

ur the man mike! Happy to put the move to ember-in-viewport as work for after we get this in!

@mariuszzak
Copy link
Author

I apologize for the long absence of answers.

@hhff I think it's not worth to couple this plugin with ember-in-viewport just for so tiny feature. I'm not enthusiast of running a combine-harvester for one ear of grain :)

@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>
Copy link
Collaborator

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

@mariuszzak
Copy link
Author

The same spec's failures are on master branch currently. New release of ember-beta brought some changes. Any idea?

@hhff
Copy link
Collaborator

hhff commented Dec 7, 2015

Looks like we're going to have to move the infinity-loader unit tests to integration tests

@mariuszzak
Copy link
Author

Tests seem to be ok now. Is there anything I should refine?

@hhff
Copy link
Collaborator

hhff commented Dec 22, 2015

👍 LGTM - @davidgoli / @kellyselden wanna give this a final gaze?

if(this.get('developmentMode')) {
return false;
}
return this._bottomOfScrollableOffset() > this._triggerOffset();
Copy link
Collaborator

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();

@davidgoli
Copy link
Collaborator

Nice work

@davidgoli
Copy link
Collaborator

Just a few formatting comments but this looks solid... thanks for all the tests!

@hhff
Copy link
Collaborator

hhff commented Dec 22, 2015

👍 what @davidgoli said - amazing work @mariuszzak - very very keen to land this !

@mariuszzak
Copy link
Author

Thanks a lot guys! I'm gonna improve code ASAP.

@mariuszzak
Copy link
Author

Cosmetic improvements are finished.

@davidgoli thanks again for comments! 💯

@hhff
Copy link
Collaborator

hhff commented Dec 27, 2015

Nice! I would say let's squash to a single commit and then we're ready to merge!

@mariuszzak
Copy link
Author

Ok, done :)

hhff added a commit that referenced this pull request Dec 28, 2015
@hhff hhff merged commit 5e95aa5 into adopted-ember-addons:master Dec 28, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants