diff options
author | Scott González <scott.gonzalez@gmail.com> | 2010-07-14 11:00:28 -0400 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2010-07-14 11:00:28 -0400 |
commit | c71e63cb6907e4df994e6dfa2e52d3a2dfc19b2d (patch) | |
tree | 2cc07ff7e379edf3756ce15fc9a09181d122173b /ui | |
parent | 936a9a6d9ccd676ee53bf029ee336773ba16697d (diff) | |
download | jquery-ui-c71e63cb6907e4df994e6dfa2e52d3a2dfc19b2d.tar.gz jquery-ui-c71e63cb6907e4df994e6dfa2e52d3a2dfc19b2d.zip |
Accordion: Add disabled class to headers and panels to fix styling in IE. Fixes #5332 - Accordion: Disabled accordion doesn't look disabled in IE.
Diffstat (limited to 'ui')
-rw-r--r-- | ui/jquery.ui.accordion.js | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/ui/jquery.ui.accordion.js b/ui/jquery.ui.accordion.js index 8699f8e12..6bda009e3 100644 --- a/ui/jquery.ui.accordion.js +++ b/ui/jquery.ui.accordion.js @@ -144,23 +144,21 @@ $.widget("ui.accordion", { this.element .removeClass("ui-accordion ui-widget ui-helper-reset") - .removeAttr("role") - .unbind('.accordion') - .removeData('accordion'); + .removeAttr("role"); this.headers .unbind(".accordion") - .removeClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-corner-top") + .removeClass("ui-accordion-header ui-accordion-disabled ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top") .removeAttr("role").removeAttr("aria-expanded").removeAttr("tabIndex"); this.headers.find("a").removeAttr("tabIndex"); this._destroyIcons(); - var contents = this.headers.next().css("display", "").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active"); + var contents = this.headers.next().css("display", "").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-accordion-disabled ui-state-disabled"); if (o.autoHeight || o.fillHeight) { contents.css("height", ""); } - return this; + return $.Widget.prototype.destroy.call( this ); }, _setOption: function(key, value) { @@ -175,7 +173,13 @@ $.widget("ui.accordion", { this._createIcons(); } } - + // #5332 - opacity doesn't cascade to positioned elements in IE + // so we need to add the disabled class to the headers and panels + if (key == "disabled") { + this.headers.add(this.headers.next()) + [ value ? "addClass" : "removeClass"]( + "ui-accordion-disabled ui-state-disabled" ); + } }, _keydown: function(event) { |