Problem/Motivation
When use exposed form in block and after first form change ajax scroll not working, but after second and more form changes everything is fine.
Remaining tasks
The patch is ready for review.
When use exposed form in block and after first form change ajax scroll not working, but after second and more form changes everything is fine.
The patch is ready for review.
Comments
Comment #2
zviryatko commentedComment #3
sam152 commentedI can't reproduce this. I've tried an exposed form in a block and both the manual and automatic infinite scrolling work as expected after input for every time the form is submitted.
Can you provide more detailed steps on how to reproduce or maybe post your view?
Comment #4
zviryatko commentedTested in Iceweasel (firefox for debian) 43.0.2 and in chromium 47, debian 8.2 x64.
Btw, show form in block is not required, I can reproduce bug even with inline exposed form.
Here is the link to simplytest https://rml0y.ply.st/node, but it will be work only one day.
Comment #5
zviryatko commentedIn this morning I've found that the bug not work when you use End button or click to end of scroll bar.
Here is link to video with demonstration - https://dl.dropboxusercontent.com/u/12457762/screenshot/out.ogv
Comment #6
sam152 commentedThanks for adding more info. I will have a look shortly.
Comment #7
sam152 commentedThanks for your patch. I've tested, reproduced and verified that it does indeed fix the problem.
The reason this was a problem in the first place is because when AJAX filters were applied, duplicate events were bound to 'scroll.views_infinite_scroll'. One old one with a reference to a $pager element that no longer existed and one correct one bound to the new pager returned by the AJAXed view.
When the $pager offset was checked, it returned 0 for the broken reference (indicating it was at the very top of the page) and a click was triggered on the old pager and the 'scroll.views_infinite_scroll' event was unbound from BOTH pagers (the real one and the non-existent one).
Instead of this fix I propose removing the the event in the detach handler, meaning there is never a broken $pager reference and event to begin with.
Can you apply and review the current patch? If it works for you and you're happy with the approach I can commit it and create a new release.
Comment #8
zviryatko commentedI've checked and it works for me.
Comment #9
sam152 commentedComment #11
sam152 commentedThanks your your contribution.
Comment #13
kashandarash commentedAjax scroll works but only one time.
If I change "$window.on(scroll_event, ..." to regular "$window.on('scroll', ..."
everything works.
I have the same configurations as zviryatko wrote.
Comment #14
kashandarash commentedComment #15
sam152 commentedPlease open a new issue, try the latest version and provide some further details. I can't reproduce #13.