Bug Tracker

Modify

Ticket #7610 (closed enhancement: invalid)

Opened 2 years ago

Last modified 2 years ago

.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

comment:1 Changed 2 years ago by rwaldron

  • Keywords needsreview added
  • Priority changed from undecided to low
  • Status changed from new to open
  • Component changed from unfiled to event

comment:2 Changed 2 years ago by dmethvin

  • Status changed from open to closed
  • Resolution set to invalid

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

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.