Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
document new lazy loading feature #10361
document new lazy loading feature #10361
Changes from 2 commits
7c22fe4
88df5e7
2ba954a
c99f8ca
43a197c
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we use pure javascript event handlers anywhere else in the documentation.... can you please change this to a jquery (and entwine if possible) reference to match the rest of the docs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$(el).one('lazyload') should achieve the same results, but since this is expected to be used in third party modules, i don't see the issue not using jquery or entwine. Actually, that should be real goal: provide platform agnostic support so that it works with anything, no ?
I'm not even sure how that would work with entwine (i don't think it's possible to listen to a custom event only once ?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've been thinking about this - I think the main issue is that if you just drop this pure js into
LeftAndMain.extra_requirements_javascript
you won't even be able to find the element you want to add a listener to unless it's in an entwineonmatch
(except for when you directly load the form the tab is in via URL). So we probably should add that context to the example. And by that point you're already in a jquery context anyway.