]> source.dussan.org Git - jquery-ui.git/commitdiff
UI Tabs: allow initializing an empty list, fixes #3683
authorKlaus Hartl <klaus.hartl@googlemail.com>
Sat, 10 Jan 2009 12:35:01 +0000 (12:35 +0000)
committerKlaus Hartl <klaus.hartl@googlemail.com>
Sat, 10 Jan 2009 12:35:01 +0000 (12:35 +0000)
ui/ui.tabs.js

index 4a6f939971709e6ab3bd629d71a68df9308f031f..9d69c156cce1c47f20a5992b48317d98da9135fb 100644 (file)
@@ -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);