aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKlaus Hartl <klaus.hartl@googlemail.com>2009-02-22 18:54:29 +0000
committerKlaus Hartl <klaus.hartl@googlemail.com>2009-02-22 18:54:29 +0000
commit12d2b5e7203b468697087649484051fbbf971da7 (patch)
treee63c1fb4cb7a0c13e637e5a757b62bb25ed6fb46
parent3b1ce9460a94a0db2a6032f2a4582450224b9c29 (diff)
downloadjquery-ui-12d2b5e7203b468697087649484051fbbf971da7.tar.gz
jquery-ui-12d2b5e7203b468697087649484051fbbf971da7.zip
Tabs should not use toggleClass() for state handling, fixes #4212
-rw-r--r--ui/ui.tabs.js21
1 files changed, 15 insertions, 6 deletions
diff --git a/ui/ui.tabs.js b/ui/ui.tabs.js
index 86f5dbb32..e50ab29be 100644
--- a/ui/ui.tabs.js
+++ b/ui/ui.tabs.js
@@ -224,16 +224,25 @@ $.widget("ui.tabs", {
this.$lis.add(this.$tabs).unbind('.tabs');
if (o.event != 'mouseover') {
- var handleState = function(state, el) {
+ var addState = function(state, el) {
if (el.is(':not(.ui-state-disabled)')) {
- el.toggleClass('ui-state-' + state);
+ el.addClass('ui-state-' + state);
}
};
- this.$lis.bind('mouseover.tabs mouseout.tabs', function() {
- handleState('hover', $(this));
+ var removeState = function(state, el) {
+ el.removeClass('ui-state-' + state);
+ };
+ this.$lis.bind('mouseover.tabs', function() {
+ addState('hover', $(this));
+ });
+ this.$lis.bind('mouseout.tabs', function() {
+ removeState('hover', $(this));
+ });
+ this.$tabs.bind('focus.tabs', function() {
+ addState('focus', $(this).closest('li'));
});
- this.$tabs.bind('focus.tabs blur.tabs', function() {
- handleState('focus', $(this).closest('li'));
+ this.$tabs.bind('blur.tabs', function() {
+ removeState('focus', $(this).closest('li'));
});
}