diff options
author | Scott González <scott.gonzalez@gmail.com> | 2010-07-16 20:20:28 -0400 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2010-07-16 20:20:28 -0400 |
commit | 7e03d4ea9deee68e928651ef80c6c673c479b88d (patch) | |
tree | 0a1ade66ba1b1a4783f9eace0110805c31fc58f6 /ui/jquery.ui.tabs.js | |
parent | eaddfedd668c3397ed3c39d733d57d9c78466633 (diff) | |
download | jquery-ui-7e03d4ea9deee68e928651ef80c6c673c479b88d.tar.gz jquery-ui-7e03d4ea9deee68e928651ef80c6c673c479b88d.zip |
Tabs: Updated tests.
Diffstat (limited to 'ui/jquery.ui.tabs.js')
-rw-r--r-- | ui/jquery.ui.tabs.js | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/ui/jquery.ui.tabs.js b/ui/jquery.ui.tabs.js index 2a12cb540..592f1a866 100644 --- a/ui/jquery.ui.tabs.js +++ b/ui/jquery.ui.tabs.js @@ -416,14 +416,10 @@ $.widget("ui.tabs", { _getIndex: function(index) { // meta-function to give users option to provide a href string instead of a numerical index. // also sanitizes numerical indexes to valid values. - if (typeof(index) == 'string') { + if (typeof index == 'string') { index = this.anchors.index(this.anchors.filter('[href$=' + index + ']')); - index = (index ==-1?NaN:index); - }else if (typeof(index) != 'number') { - index = NaN; - }else if (index > this.anchors.length) { - index = this.anchors.length; } + return index; }, @@ -579,7 +575,7 @@ $.widget("ui.tabs", { select: function(index) { index = this._getIndex(index); - if (isNaN(index) && this.options.collapsible) { + if (index == -1 && this.options.collapsible) { index = this.options.selected; } this.anchors.eq(index).trigger(this.options.event + '.tabs'); |