Ticket #7610 (closed enhancement: invalid)
.ready (and .readyWait) should really be implemented using the Events API
| Reported by: | cowboy | Owned by: | |
|---|---|---|---|
| Priority: | low | Milestone: | |
| Component: | event | Version: | 1.4.4 |
| Keywords: | needsreview | Cc: | |
| Blocking: | Blocked by: |
Description
Ideally, .ready( fn ) and $( fn ) should both be shortcuts for .bind( "ready", fn ), perhaps with the exception that fn in .ready( fn ) and $( fn ) is curried so that $ is passed in as a function argument instead of event (or is passed in before the event argument).
Instead of some plugin incrementing the .readyWait property to indicate that the "ready" event needs to be deferred, that plugin could instead bind a "ready" event handler that calls e.preventDefault() or e.stopPropagation() (as necessary depending on the implementation) to prevent other "ready" event handlers from firing. Once the plugin is actually ready, it could then unbind itself and re-trigger the "ready" event.
Or something along those lines.
Either way, it would be nice for the "ready" event to behave more similarly to other jQuery events, instead of being a somewhat awkward special case.
This could tie into #7279. Also, .readyWait was introduced in #6781.
Change History
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
