UI Tabs: fixed mouseover event option conflicting with default state handling (fixes #3799), cleaned up white space

This commit is contained in:
Klaus Hartl 2009-01-19 20:40:51 +00:00
parent f3ae85024a
commit 8ff7897aa2

View File

@ -187,15 +187,18 @@ $.widget("ui.tabs", {
}
// states
if (o.event != 'mouseover') {
var handleState = function(state, el) {
if (el.is(':not(.ui-state-disabled)')) el.toggleClass('ui-state-' + state);
};
this.$lis.bind('mouseover.tabs mouseout.tabs', function() {
handleState('hover', $(this));
});
// TODO focus/blur don't seem to work with namespace
this.$tabs.bind('focus.tabs blur.tabs', function() {
handleState('focus', $(this).parents('li:first'));
});
}
// clean up to avoid memory leaks in certain versions of IE 6
$(window).bind('unload', function() {