diff options
author | Richard Worth <rdworth@gmail.com> | 2009-12-31 13:43:54 +0000 |
---|---|---|
committer | Richard Worth <rdworth@gmail.com> | 2009-12-31 13:43:54 +0000 |
commit | 41749bf12209157475806cfe0a4e6d37c5a06bf1 (patch) | |
tree | c44beb36d91e3fa212b5554e8db921259dd62918 /ui/jquery.ui.tabs.js | |
parent | 5ab4b615a52e1b826d4db37a2174d2abca7056ac (diff) | |
download | jquery-ui-41749bf12209157475806cfe0a4e6d37c5a06bf1.tar.gz jquery-ui-41749bf12209157475806cfe0a4e6d37c5a06bf1.zip |
Fixed #4960 - Tabs: wrong selected tab index
Diffstat (limited to 'ui/jquery.ui.tabs.js')
-rw-r--r-- | ui/jquery.ui.tabs.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ui/jquery.ui.tabs.js b/ui/jquery.ui.tabs.js index b9fad83d4..2d6a992c0 100644 --- a/ui/jquery.ui.tabs.js +++ b/ui/jquery.ui.tabs.js @@ -150,7 +150,7 @@ $.widget("ui.tabs", { if (typeof o.selected != 'number' && this.lis.filter('.ui-tabs-selected').length) { o.selected = this.lis.index(this.lis.filter('.ui-tabs-selected')); } - o.selected = o.selected || 0; + o.selected = o.selected || this.lis.length ? 0 : -1; } else if (o.selected === null) { // usage of null is deprecated, TODO remove in next release o.selected = -1; @@ -468,6 +468,7 @@ $.widget("ui.tabs", { this._tabify(); if (this.anchors.length == 1) { // after tabify + o.selected = 0; $li.addClass('ui-tabs-selected ui-state-active'); $panel.removeClass('ui-tabs-hide'); this.element.queue("tabs", function() { |