From 5435c50765e89f5cfb1c164dda6642c2149dc4db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Sat, 17 Jul 2010 18:50:47 -0400 Subject: [PATCH] Tabs: Fixed select method handling for index of -1. --- ui/jquery.ui.tabs.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ui/jquery.ui.tabs.js b/ui/jquery.ui.tabs.js index 592f1a866..5555b95f5 100644 --- a/ui/jquery.ui.tabs.js +++ b/ui/jquery.ui.tabs.js @@ -575,8 +575,12 @@ $.widget("ui.tabs", { select: function(index) { index = this._getIndex(index); - if (index == -1 && this.options.collapsible) { - index = this.options.selected; + if (index == -1) { + if (this.options.collapsible && this.options.selected != -1) { + index = this.options.selected; + } else { + return this; + } } this.anchors.eq(index).trigger(this.options.event + '.tabs'); return this;