From: Klaus Hartl Date: Sat, 10 Jan 2009 12:35:01 +0000 (+0000) Subject: UI Tabs: allow initializing an empty list, fixes #3683 X-Git-Tag: 1.6rc5~43 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=db738053ca93dbc3e7f501d82952ca2704e8a2d8;p=jquery-ui.git UI Tabs: allow initializing an empty list, fixes #3683 --- diff --git a/ui/ui.tabs.js b/ui/ui.tabs.js index 4a6f93997..9d69c156c 100644 --- a/ui/ui.tabs.js +++ b/ui/ui.tabs.js @@ -150,7 +150,7 @@ $.widget("ui.tabs", { // highlight selected tab this.$panels.addClass(o.hideClass); this.$lis.removeClass(o.selectedClass); - if (o.selected !== null) { + if (o.selected !== null && this.$tabs.length) { // check for length avoids error when initializing empty list this.$panels.eq(o.selected).removeClass(o.hideClass); var classes = [o.selectedClass]; if (o.deselectable) classes.push(o.deselectableClass);