jeremenichelli / hunt

👻 Minimal library to observe nodes entering and leaving the viewport
https://jeremenichelli.github.io/hunt
MIT License
342 stars 10 forks source link

Page depth change without scroll event = issue #15

Closed mg-design closed 7 years ago

mg-design commented 7 years ago

Hi. I have a problem - I am filtering a listing, causing a containing div to resize, which brings 'hunted' elements into the viewport. The lack of scroll event means that Hunt doesn't update. Is there anyway I can invoke a Hunt 'update/refresh' programmatically, as I don't want to have to scroll the page? May thanks, Mike

jeremenichelli commented 7 years ago

Hi Mike, the internal method is not exposed but it can be easily added.

I'll try to update it today and let you know on this issue.

Thanks for reporting.

mg-design commented 7 years ago

Brilliant. Thank you so much!

jeremenichelli commented 7 years ago

@SemanticMikeG a patch has been released covering this, you can call hunt.trigger() and will go through all the elements buffered and check if some have become visible.

Not recommending to call this too often if you have tons of element, but at least it should cover your case. Let me know if you run into performance issues.

Cheers!

mg-design commented 7 years ago

That's great. Thanks very much. I'll test with it tomorrow. All the best, Mike

Sent from my iPad

On 11 Jan 2017, at 22:00, Jeremias Menichelli notifications@github.com wrote:

@SemanticMikeG a patch has been released covering this, you can call hunt.trigger() and will go through all the elements buffered and check if some have become visible.

Not recommending to call this too often if you have tons of element, but at least it should cover your case. Let me know if you run into performance issues.

Cheers!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

mg-design commented 7 years ago

Hi Jeremias,

This patch is working perfectly for me - thanks so much.

Is there any way to get this updated version into Bower so I can get it out to the rest of my dev team?

Many thanks, Mike

On 11 Jan 2017, at 22:00, Jeremias Menichelli notifications@github.com wrote:

@SemanticMikeG https://github.com/SemanticMikeG a patch has been released covering this, you can call hunt.trigger() and will go through all the elements buffered and check if some have become visible.

Not recommending to call this too often if you have tons of element, but at least it should cover your case. Let me know if you run into performance issues.

Cheers!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jeremenichelli/hunt/issues/15#issuecomment-272009167, or mute the thread https://github.com/notifications/unsubscribe-auth/AX5kLl9VItRfr552u_SGBs_Ztz-g_hiPks5rRVEEgaJpZM4Lgvv9.

jeremenichelli commented 7 years ago

Completely forgot about that, @SemanticMikeG the patch is now available in bower.