Tabs: Never remove the ui-state-default class when switching tabs.

Fixes #4815 - Tabs: each tab needs to have state ui-state-default.
This commit is contained in:
Scott González 2009-11-13 03:18:55 +00:00
parent ef02b168ef
commit 18e256849c

View File

@ -273,7 +273,7 @@ $.widget("ui.tabs", {
// Show a tab... // Show a tab...
var showTab = showFx ? var showTab = showFx ?
function(clicked, $show) { function(clicked, $show) {
$(clicked).closest('li').removeClass('ui-state-default').addClass('ui-tabs-selected ui-state-active'); $(clicked).closest('li').addClass('ui-tabs-selected ui-state-active');
$show.hide().removeClass('ui-tabs-hide') // avoid flicker that way $show.hide().removeClass('ui-tabs-hide') // avoid flicker that way
.animate(showFx, showFx.duration || 'normal', function() { .animate(showFx, showFx.duration || 'normal', function() {
resetStyle($show, showFx); resetStyle($show, showFx);
@ -281,7 +281,7 @@ $.widget("ui.tabs", {
}); });
} : } :
function(clicked, $show) { function(clicked, $show) {
$(clicked).closest('li').removeClass('ui-state-default').addClass('ui-tabs-selected ui-state-active'); $(clicked).closest('li').addClass('ui-tabs-selected ui-state-active');
$show.removeClass('ui-tabs-hide'); $show.removeClass('ui-tabs-hide');
self._trigger('show', null, self._ui(clicked, $show[0])); self._trigger('show', null, self._ui(clicked, $show[0]));
}; };
@ -290,14 +290,14 @@ $.widget("ui.tabs", {
var hideTab = hideFx ? var hideTab = hideFx ?
function(clicked, $hide) { function(clicked, $hide) {
$hide.animate(hideFx, hideFx.duration || 'normal', function() { $hide.animate(hideFx, hideFx.duration || 'normal', function() {
self.lis.removeClass('ui-tabs-selected ui-state-active').addClass('ui-state-default'); self.lis.removeClass('ui-tabs-selected ui-state-active');
$hide.addClass('ui-tabs-hide'); $hide.addClass('ui-tabs-hide');
resetStyle($hide, hideFx); resetStyle($hide, hideFx);
self.element.dequeue("tabs"); self.element.dequeue("tabs");
}); });
} : } :
function(clicked, $hide, $show) { function(clicked, $hide, $show) {
self.lis.removeClass('ui-tabs-selected ui-state-active').addClass('ui-state-default'); self.lis.removeClass('ui-tabs-selected ui-state-active');
$hide.addClass('ui-tabs-hide'); $hide.addClass('ui-tabs-hide');
self.element.dequeue("tabs"); self.element.dequeue("tabs");
}; };