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

The 'fragment' of 'onCompleted' callback is not a live set of Nodes #132

Open
interDist opened this issue Jul 19, 2019 · 0 comments
Open

Comments

@interDist
Copy link

interDist commented Jul 19, 2019

The onCompleted callback for AJAX'ed pagination uses two parameters: context and fragment, the former being an object containing information about the requested page while the latter is a mere String (data as returned by the server).

While this fragment can have its uses, it will be much more useful if the callback function would be passed the actual DOM (or jQuery) object already inserted into the page. Specifically, in a backwards-compatible manner:

  function(context, fragmentString, fragmentObject) { ... }

with fragmentObject being basically the result of $(fragment).
(It cannot obviously be done in the callback function itself, because this operation will create a new set of DOM nodes, rather than referring to the set already inserted into the DOM tree by the el_pagination script.)

[For context, my own use case requires running an operation on the newly-added nodes and only on them, not on the nodes already existing on the page...]

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

No branches or pull requests

1 participant