Skip to content
Permalink
Browse files

Accordion: #3646 - add hover classes and unbind on destroy

  • Loading branch information
jzaefferer committed Dec 12, 2008
1 parent ad19cf1 commit 28c5c53a09d1218e3688aaedc9665ea5ad772cc2
Showing with 4 additions and 2 deletions.
  1. +4 −2 ui/ui.accordion.js
@@ -31,7 +31,9 @@ $.widget("ui.accordion", {

this.element.addClass("ui-accordion ui-widget ui-helper-reset");
var groups = this.element.children().addClass("ui-accordion-group");
var headers = options.headers = groups.find("> :first-child").addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all");
var headers = options.headers = groups.find("> :first-child").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'); });
// wrap content elements in div against animation issues
headers.next().wrap("<div/>").addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom");

@@ -100,7 +102,7 @@ $.widget("ui.accordion", {
this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role").unbind(".accordion");
$.removeData(this.element[0], "accordion");
var groups = this.element.children().removeClass("ui-accordion-group selected");
var headers = this.options.headers.removeClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-corner-top")
var headers = this.options.headers.unbind(".accordion").removeClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-corner-top")
.removeAttr("role").removeAttr("aria-expanded").removeAttr("tabindex");
headers.find("a").removeAttr("tabindex");
headers.children(".ui-icon").remove();

0 comments on commit 28c5c53

Please sign in to comment.
You can’t perform that action at this time.