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

destroy destroy loophole #160

Closed
fieg opened this Issue Oct 1, 2014 · 1 comment

Comments

Projects
None yet
2 participants
@fieg
Member

fieg commented Oct 1, 2014

The solution should be to just re-initialize the infinite scroll once the load has completed:

However, this will not work, because $.ias() attempts to be idempotent by memoizing this method, assigning data with the "ias" key to the global window object.

It appears that the makers of ias have given us a loophole to fix this, though it is not documented. You can pass the string "destroy" to $.ias() and remove the memoized data, allowing us to call it again and reinstall the scroll listeners. (https://github.com/webcreate/infinite-ajax-scroll/blob/master/src/jquery-ias.js#L553)

As discovered by Lee Byron

Solution I'm currently thinking of would be to call $this.data('ias', null); from the destroy method.

@seansean11

This comment has been minimized.

seansean11 commented Nov 24, 2014

Should this also destroy ias extensions? This works for me with the main portion of the plugin, but I am unable to reinstantiate the two extensions that I'm running (spinner and noneLeft).

@fieg fieg added the Critical label Nov 30, 2014

@fieg fieg closed this in 3b17638 Dec 9, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment