]> source.dussan.org Git - jquery-ui.git/commitdiff
UI Tabs: update selected property after add/remove, fixes #3065
authorKlaus Hartl <klaus.hartl@googlemail.com>
Fri, 15 Aug 2008 14:43:44 +0000 (14:43 +0000)
committerKlaus Hartl <klaus.hartl@googlemail.com>
Fri, 15 Aug 2008 14:43:44 +0000 (14:43 +0000)
ui/ui.tabs.js

index 4013e3ca773218c546cef084c642a05133fea339..7f54e36aa8a10f9f7019a64bc8d051900fc1be8c 100644 (file)
@@ -73,6 +73,7 @@ $.widget("ui.tabs", {
                                o.disabled.push(i + 1);
                });
 
+               // initialization from scratch
                if (init) {
 
                        // attach necessary classes for styling if not present
@@ -153,6 +154,9 @@ $.widget("ui.tabs", {
                        });
 
                }
+               // update selected after add/remove
+               else
+                       o.selected = this.$lis.index( this.$lis.filter('.' + o.selectedClass)[0] );
 
                // disable tabs
                for (var i = 0, li; li = this.$lis[i]; i++)