[jQuery] Interface Sortable - onchange not firing first time

[jQuery] Interface Sortable - onchange not firing first time

<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:verdana, helvetica, sans-serif;font-size:10pt"><div style="font-family: verdana,helvetica,sans-serif; font-size: 10pt;">When is the interface.js going to be updated with the latest changes?
thanks - wg
<div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">----- Original Message ----
From: Stefan Petre <stefan.petre@gmail.com>
To: jQuery Discussion. <discuss@jquery.com>
Sent: Saturday, February 3, 2007 12:28:13 AM
Subject: Re: [jQuery] Interface Sortable - onchange not firing first time
<div>This bug is already fixed in SVN
rcarlos21 wrote:
> I was having the same problem. I found out that the problem wasn't really the
> fact that it wasn't calling onChange() on the first change but rather that
> it calls onChange with those changes on the next successive change.

>
> Say I started with a list:
>
> Item 1 --- Item 2 --- Item 3 --- Item 4 --- Item 5
>
> If i were to initially drag "Item 1" and drop it between "Item 4" and "Item
> 5," onChange is not called and the following list results:
>
> Item 2 --- Item 3 --- Item 4 --- Item 1 --- Item 5
>
> Then, if I drag "Item 2" and drop it between "Item 1" and "Item 5," onChange
> is called but with the serialized list of "2, 3, 4, 1, 5" despite the fact
> that the resulting list is:
>
> Item 3 --- Item 4 --- Item 1 --- Item 2 --- Item 5
>
> The reason for this is because the check() method in the iSort class
> calculates whether a change has been made before it applies the current
> change, which was effected by dropping the item, to the DOM.  This order
> causes the onChange method to be called a change late because, to it, the
> change hasn't technically
happened yet.  Trying to work out in my mind
> exactly how this method works is proving to be rather difficult, but I did
> manage to fix the bug by simply moving the code segment that applies the
> change to the DOM up above the segment that calculates whether a change has
> been made.
>
> Here are the two modified files (the source code file and the packed file,
> respectively):
>
> <a target="_blank" href="http://www.nabble.com/file/6224/isortables-src.js">http://www.nabble.com/file/6224/isortables-src.js</a> isortables-src.js
> <a target="_blank" href="http://www.nabble.com/file/6225/isortables-packed.js">http://www.nabble.com/file/6225/isortables-packed.js</a> isortables-packed.js
>
> That fix has worked for me, and hopefully it will help you out too.   I'm
> also going to post this bug and the accompanying fix to the jQuery forum.
>
>
> wgpubs