Opened 14 years ago
Closed 12 years ago
#6150 closed bug (fixed)
.stop sometimes doesn't clear .delay
Reported by: | cowboy | Owned by: | gnarf |
---|---|---|---|
Priority: | blocker | Milestone: | 1.7 |
Component: | effects | Version: | 1.4.1 |
Keywords: | delay, stop, setTimeout, 1.7-discuss | Cc: | |
Blocked by: | Blocking: |
Description
If .stop is called after the setTimeout in .delay has executed, there's no way for that setTimeout to be stopped, so the callback executes after "time" milliseconds, no matter what.
Change History (25)
comment:1 Changed 13 years ago by
Component: | unfiled → fx |
---|
comment:2 Changed 13 years ago by
Owner: | set to cowboy |
---|---|
Priority: | → undecided |
Status: | new → pending |
comment:3 Changed 13 years ago by
Status: | pending → new |
---|
Here you go, sorry I never added this into the ticket!
comment:4 Changed 13 years ago by
Keywords: | delay stop setTimeout added |
---|---|
Milestone: | 1.4.2 → 1.5 |
Priority: | undecided → low |
Status: | new → open |
Appreciate the test case, ben.
comment:5 Changed 13 years ago by
Owner: | changed from cowboy to john |
---|---|
Status: | open → assigned |
comment:6 Changed 13 years ago by
Milestone: | → 1.next |
---|---|
Priority: | low → blocker |
comment:8 Changed 12 years ago by
Just "me too"-ing. stop()
should stop delays. It seems like it should be really easy to implement delay()
as an animation of the given duration that doesn't actually change anything (if, unlike me, you already understand how jQuery's animation infrastructure works). That would make it play nicely with the various other animation functions (like stop()
).
comment:10 Changed 12 years ago by
You could just animate a non-property
$.fn.delay = function( duration ) { return this.animate({ _: 0 }, duration);
However, This brings up a great point.... stopHooks...
There are a lot of UI effects that CANT be .stop()'ed because they don't actually use the queue... It might be nice to create some sort of method that non-standard animates can provide a function to be called on stop...
Imagine:
$.fn.delay = function( duration ) { return this.queue( function( next, onstop ) { var timer = setTimeout( next, duration ); onstop( function( gotoEnd ) { clearTimeout( timer ); if ( gotoEnd ) { next(); } }); }); };
comment:14 Changed 12 years ago by
+1, could this be fixed by simply adding the setTimeout timer to jQuery.timers?
comment:21 Changed 12 years ago by
Milestone: | 1.next → 1.7 |
---|
comment:22 Changed 12 years ago by
Owner: | changed from john to gnarf |
---|
comment:23 Changed 12 years ago by
Milestone: | 1.7 → 1.6.3 |
---|
comment:24 Changed 12 years ago by
Milestone: | 1.6.3 → 1.7 |
---|
We are currently favoring a fix for this that would include an additional parameter for delay and considering delay has always behaved this way, we're going to push this to 1.7.
comment:25 Changed 12 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Landing pull request 514. 1.7 - queue refactoring to handle delay stop - Fixes #6150.
More Details:
Please submit a valid test case that reproduces this issue.