Tabs: Fixed select method handling for index of -1.

This commit is contained in:
Scott González 2010-07-17 18:50:47 -04:00
parent 7e03d4ea9d
commit 5435c50765

View File

@ -575,8 +575,12 @@ $.widget("ui.tabs", {
select: function(index) { select: function(index) {
index = this._getIndex(index); index = this._getIndex(index);
if (index == -1 && this.options.collapsible) { if (index == -1) {
index = this.options.selected; if (this.options.collapsible && this.options.selected != -1) {
index = this.options.selected;
} else {
return this;
}
} }
this.anchors.eq(index).trigger(this.options.event + '.tabs'); this.anchors.eq(index).trigger(this.options.event + '.tabs');
return this; return this;