-
Notifications
You must be signed in to change notification settings - Fork 824
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
Conversation
@GuySartorelli here are the docs ;-) PR reference : silverstripe/silverstripe-admin#1309
docs/en/02_Developer_Guides/15_Customising_the_Admin_Interface/02_CMS_Architecture.md
Outdated
Show resolved
Hide resolved
…/02_CMS_Architecture.md Co-authored-by: Michal Kleiner <[email protected]>
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.
Sorry it took me so long to look at this. A few requested changes here.
Also I have started the process of migrating docs to a new repository, so this PR should be closed and a new one should be created there (sorry about that, poor timing).
docs/en/02_Developer_Guides/15_Customising_the_Admin_Interface/02_CMS_Architecture.md
Outdated
Show resolved
Hide resolved
docs/en/02_Developer_Guides/15_Customising_the_Admin_Interface/02_CMS_Architecture.md
Outdated
Show resolved
Hide resolved
They will receive a `lazyload` event that can be listened to in the following way: | ||
|
||
```js | ||
el.addEventListener( |
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 entwine onmatch
(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.
docs/en/02_Developer_Guides/15_Customising_the_Admin_Interface/02_CMS_Architecture.md
Outdated
Show resolved
Hide resolved
…/02_CMS_Architecture.md Co-authored-by: Guy Sartorelli <[email protected]>
…/02_CMS_Architecture.md Co-authored-by: Guy Sartorelli <[email protected]>
…/02_CMS_Architecture.md Co-authored-by: Guy Sartorelli <[email protected]>
Closed in favor of silverstripe/developer-docs#427 |
@GuySartorelli here are the docs ;-)
PR reference : silverstripe/silverstripe-admin#1309