mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
UI Tabs: allow initializing an empty list, fixes #3683
This commit is contained in:
parent
71a97f2561
commit
db738053ca
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user