aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2010-07-13 09:10:43 -0400
committerScott González <scott.gonzalez@gmail.com>2010-07-13 09:10:43 -0400
commit551bf6e1e7844dc3ea4ca62a3bf0e7cb4c18744b (patch)
tree1374466890f9ea273a366d678f10836fd0bef7fc /ui
parent2bf91e8e28e3936ed56def5648dda479aefa9ad2 (diff)
downloadjquery-ui-551bf6e1e7844dc3ea4ca62a3bf0e7cb4c18744b.tar.gz
jquery-ui-551bf6e1e7844dc3ea4ca62a3bf0e7cb4c18744b.zip
Accordion: Don't handle hover/focus when disabled. Fixes #5330 - Accordion headers still show rollover when disabled.
Diffstat (limited to 'ui')
-rw-r--r--ui/jquery.ui.accordion.js23
1 files changed, 18 insertions, 5 deletions
diff --git a/ui/jquery.ui.accordion.js b/ui/jquery.ui.accordion.js
index 07fad3130..c8025cbbf 100644
--- a/ui/jquery.ui.accordion.js
+++ b/ui/jquery.ui.accordion.js
@@ -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()