Skip to content

Commit 551bf6e

Browse files
committed
Accordion: Don't handle hover/focus when disabled. Fixes #5330 - Accordion headers still show rollover when disabled.
1 parent 2bf91e8 commit 551bf6e

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

ui/jquery.ui.accordion.js

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,24 @@ $.widget("ui.accordion", {
4242
// in lack of child-selectors in CSS we need to mark top-LIs in a UL-accordion for some IE-fix
4343
this.element.children("li").addClass("ui-accordion-li-fix");
4444

45-
this.headers = this.element.find(o.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all")
46-
.bind("mouseenter.accordion", function(){ $(this).addClass('ui-state-hover'); })
47-
.bind("mouseleave.accordion", function(){ $(this).removeClass('ui-state-hover'); })
48-
.bind("focus.accordion", function(){ $(this).addClass('ui-state-focus'); })
49-
.bind("blur.accordion", function(){ $(this).removeClass('ui-state-focus'); });
45+
this.headers = this.element.find(o.header)
46+
.addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all")
47+
.bind("mouseenter.accordion", function() {
48+
if (o.disabled) { return; }
49+
$(this).addClass('ui-state-hover');
50+
})
51+
.bind("mouseleave.accordion", function() {
52+
if (o.disabled) { return; }
53+
$(this).removeClass('ui-state-hover');
54+
})
55+
.bind("focus.accordion", function() {
56+
if (o.disabled) { return; }
57+
$(this).addClass('ui-state-focus');
58+
})
59+
.bind("blur.accordion", function() {
60+
if (o.disabled) { return; }
61+
$(this).removeClass('ui-state-focus');
62+
});
5063

5164
this.headers
5265
.next()

0 commit comments

Comments
 (0)