Ticket #2528334 (closed enhancement)
Reporter Luke Smith |
Opened: 10/16/09 Last modified: 08/1/12 Status: closed Type: enhancement Resolution: fixed |
Owner Dav Glass |
Target Release: 3.6.0 Priority: P3 (normal) |
|---|---|---|---|
| Summary: | YUI configuration to delay use() callback until domready or window load | ||
| Description: | Depending on where implementers put the YUI instantiation code, there will be a race between the async module loading and the DOM tree assembly status. In YUI 2, it was typical to use It appears the only way to ensure safe DOM manipulation would be to either put the instantiation code at the bottom of the body or wrap a decent chunk of the use() callback in a Y.on('domready', ... ) It would be convenient to have this eventuality handled by a constructor config, e.g. delayUntil: 'domready' or 'window.load', whereby the use callback would be wrapped in the appropriate event I can also imagine something like delayUntil: '#container.contentready', but the selector syntax vs the target and event identification would be messy (and require Selector). |
||
| Type: | enhancement | Observed in Version: | 3.0.0 |
| Component: | YUI Global Object | Severity: | S3 (normal) |
| Assigned To: | Dav Glass | Target Release: | 3.6.0 |
| Location: | Library Code | Priority: | P3 (normal) |
| Tags: | Relates To: | ||
| Browsers: | N/A | ||
| URL: | |||
| Test Information: | |||
Change History
|
Posted: 10/16/09
|
|
Posted: 04/20/11
|
|
Posted: 04/26/11
|
|
Posted: 03/30/12
Ticket #2528133 was marked as a duplicate of this ticket. |
|
Posted: 04/5/12
|
|
Posted: 04/5/12
|
|
Posted: 05/11/12
|
|
Posted: 05/15/12
|
|
Posted: 05/15/12
Fixes #2528334 - Added delayUntil config option You can now delay the use callback until |
|
Posted: 08/1/12
Shipped in 3.6.0. Marking closed/fixed. |
There is actually another feature request for this somewhere, but it doesn't include the window load event option. It is important to note that use() consumers can use either one of the events and be assured that they will fire regardless of whether or not they have already happened (given the normal use case where YUI was included on the page inline).