UI Tabs: update selected property after add/remove, fixes #3065

This commit is contained in:
Klaus Hartl 2008-08-15 14:43:44 +00:00
parent 23167f8a38
commit 2675acc088

View File

@ -73,6 +73,7 @@ $.widget("ui.tabs", {
o.disabled.push(i + 1); o.disabled.push(i + 1);
}); });
// initialization from scratch
if (init) { if (init) {
// attach necessary classes for styling if not present // 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 // disable tabs
for (var i = 0, li; li = this.$lis[i]; i++) for (var i = 0, li; li = this.$lis[i]; i++)