very simple enhancement for ui.tabs, code included:
Dear all,
I have filed a feature request sommme time ago, and shortly thereafter
I found the solution inside the very own plugin code.
We can programmatically select a tab in a ui.tabs widget by passing
either the tab index or the href value which is contained in the tab-
nav A element.
I needed to remove a tab regardless of the order of the tabs, so I
figured that using the same mechanism as the select() would be good
(by href). Unfortunately, the current codebase does not support this.
Then I filed this bug: http://dev.jqueryui.com/ticket/3171
On closer inspection, I found out that 2 magic lines of code grant
that function to the select() function, and that copying those to
remove() would enhance its functionality.
I patched my jQuery and have been using remove() by href without
problems since then.
But since it'such a no-brainer to change, I am asking if this can be
integrated in jQuery 1.7. It's really trivial.
remove() starts like this (as of 1.6rc6) :
-----
remove: function(index) {
var o = this.options, $li = this.$lis.eq(index).remove(),
$panel = this.$panels.eq(index).remove();
-----
All I have to do is change it to:
-----
remove: function(index) {
if (typeof index == 'string')
index = this.$tabs.index( this.$tabs.filter('[href$=' +
index + ']')[0] );
var o = this.options, $li = this.$lis.eq(index).remove(),
$panel = this.$panels.eq(index).remove();
-----
to be able to pass a href as a parameter for it to be removed.
Thanks for the attention,
Brazilian Joe