cowboy/jquery-dotimeout — Issue #3: Problems when called from inside a handler
Author: iangilman
Created: 2011-10-18 20:11:31+00:00
State: open

Great plugin! One issue:

In this example:

$.doTimeout("foo", 100, function() {
log("in");
$.doTimeout("foo", 1000, function() {
log("out");
});
});

... the inner doTimeout should clear away any others with the same ID, but it does not. Wrapping the inner doTimeout in a setTimeout fixes it, so I assume it has to do with setting up a new doTimeout from within its own handler.

Minimal test case:

http://jsfiddle.net/MmJwj/

I suppose it may look contrived, but it's from a real use-case; I can give more detail if needed.

Thanks.