.delay() bugfix and extension

.delay() bugfix and extension

Hello,

I tried to fix the .delay() problems, listed here:



You can find an update for queue.js at the first bug description. It needs more testing, but works on the added tests and also is backwards compatible.

Grab updated queue.js and test.html here:  http://dev.jquery.com/ticket/6576


There are currently two things that need improvement:

1. I tried to generate a unique id for all timeouts for an element, if no timeout id is given. This is currently done with: 

  1. (type + jQuery.now() + Math.random() * 9999999 )
But it's very lame, maybe sometimes random will generate the same number. Is there any real unique id generator implemented alredy in jquery?

2. If removeDelay(delayId) is called, removeQueue() is called, if the last delay of the element is removed. This is also very lame. I need to add a functionality that splices a position out of the queue. Currently the queue needs to be cleaned, before new jquery operations can be applied to an element, because by removing the timeout within a queue, the whole queue will become invalid.


If you give me access to the git project, I coould push it there. My git id is "JurekRaben".




Thanks and regards,

Jurek