Skip to content

Commit

Permalink
Accordion: Don't handle hover/focus when disabled. Fixes #5330 - Acco…
Browse files Browse the repository at this point in the history
…rdion headers still show rollover when disabled.
  • Loading branch information
scottgonzalez committed Jul 13, 2010
1 parent 2bf91e8 commit 551bf6e
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions ui/jquery.ui.accordion.js
Expand Up @@ -42,11 +42,24 @@ $.widget("ui.accordion", {
// in lack of child-selectors in CSS we need to mark top-LIs in a UL-accordion for some IE-fix
this.element.children("li").addClass("ui-accordion-li-fix");

this.headers = this.element.find(o.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all")
.bind("mouseenter.accordion", function(){ $(this).addClass('ui-state-hover'); })
.bind("mouseleave.accordion", function(){ $(this).removeClass('ui-state-hover'); })
.bind("focus.accordion", function(){ $(this).addClass('ui-state-focus'); })
.bind("blur.accordion", function(){ $(this).removeClass('ui-state-focus'); });
this.headers = this.element.find(o.header)
.addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all")
.bind("mouseenter.accordion", function() {
if (o.disabled) { return; }
$(this).addClass('ui-state-hover');
})
.bind("mouseleave.accordion", function() {
if (o.disabled) { return; }
$(this).removeClass('ui-state-hover');
})
.bind("focus.accordion", function() {
if (o.disabled) { return; }
$(this).addClass('ui-state-focus');
})
.bind("blur.accordion", function() {
if (o.disabled) { return; }
$(this).removeClass('ui-state-focus');
});

this.headers
.next()
Expand Down

0 comments on commit 551bf6e

Please sign in to comment.