I have put together a demo of the issue.
Basically the wrong tab is removed after sorting. Not all so开发者_运维技巧rting creates the problem so follow my example in the JSFiddle JavaScript section. I have two examples of funny business:
http://jsfiddle.net/GM9BQ/ (rather long demo)
http://jsfiddle.net/GM9BQ/7/ (considerably shortened)
http://jsfiddle.net/GM9BQ/13/ (Same as 7 (above) but removes tab using the href)
Both show different problems.
These have been an issue for ages now and I see the issue in the upcoming 1.9 release too.
So if anyone can help resolve this, I'd be much appreciated.
p.s. I made a post at the jquery forum too.
http://forum.jquery.com/topic/jquery-tabs-wrong-tab-removed-after-sorting
I found that the event was getting fired multiple times, so I added basic check. You can also implement check based on number of tabs.
Please check http://jsfiddle.net/GM9BQ/1/.
Note that the I removed some of the code to ease the debugging. Hope it will help.
For clarity, the issue is that the tab is successfully being sorted but the tab panel is not. The answer therefore is to update the panel to mirror the same position as its corresponding tab.
Thanks to Ajay for working this out in the previous post. The updated example can be seen here.
http://jsfiddle.net/GM9BQ/23/
Note the addTabSortableEvent functions update method.
精彩评论