Skip to main content

Bug Tracker

Side navigation

#7610 closed enhancement (invalid)

Opened November 23, 2010 05:07PM UTC

Closed March 31, 2011 06:07PM UTC

.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:
Blocked by: Blocking:
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.

Attachments (0)
Change History (2)

Changed November 23, 2010 06:37PM UTC by rwaldron comment:1

component: unfiledevent
keywords: → needsreview
priority: undecidedlow
status: newopen

Changed March 31, 2011 06:07PM UTC by dmethvin comment:2

resolution: → invalid
status: openclosed

We've implemented .ready in terms of Deferreds now, and will be committing cowboy's unit tests to be sure it doesn't break.