accordion: all classes added should have a 'ui-' prefix (fixes #3705)

This commit is contained in:
Paul Bakaus 2009-01-07 16:17:12 +00:00
parent 1bdd309013
commit f48f615ec0
2 changed files with 5 additions and 5 deletions

View File

@ -2,7 +2,7 @@
----------------------------------*/ ----------------------------------*/
.ui-accordion-group {margin-bottom: 1px;} .ui-accordion-group {margin-bottom: 1px;}
.ui-accordion-header { cursor: pointer; position: relative; } .ui-accordion-header { cursor: pointer; position: relative; }
.selected .ui-accordion-header { border-bottom: 0; } .ui-accordion-selected .ui-accordion-header { border-bottom: 0; }
.ui-accordion .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; } .ui-accordion .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; }
.ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em 2.2em; } .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em 2.2em; }
.ui-accordion-content-wrap { border-top: 0; margin-top: -1px; position: relative; top: 1px; } .ui-accordion-content-wrap { border-top: 0; margin-top: -1px; position: relative; top: 1px; }

View File

@ -24,7 +24,7 @@ $.widget("ui.accordion", {
options.active = current; options.active = current;
} else { } else {
options.active = current.parent().parent().prev(); options.active = current.parent().parent().prev();
current.addClass("current"); current.addClass("ui-accordion-current");
} }
} }
} }
@ -38,7 +38,7 @@ $.widget("ui.accordion", {
headers.next().wrap("<div></div>").addClass("ui-accordion-content").parent().addClass("ui-accordion-content-wrap ui-helper-reset ui-widget-content ui-corner-bottom"); headers.next().wrap("<div></div>").addClass("ui-accordion-content").parent().addClass("ui-accordion-content-wrap ui-helper-reset ui-widget-content ui-corner-bottom");
var active = options.active = findActive(headers, options.active).toggleClass("ui-state-default").toggleClass("ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top"); var active = options.active = findActive(headers, options.active).toggleClass("ui-state-default").toggleClass("ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top");
active.parent().addClass("selected"); active.parent().addClass(options.selectedClass);
$("<span/>").addClass("ui-icon " + this.options.icons.header).prependTo(headers); $("<span/>").addClass("ui-icon " + this.options.icons.header).prependTo(headers);
active.find(".ui-icon").toggleClass(this.options.icons.header).toggleClass(this.options.icons.headerSelected); active.find(".ui-icon").toggleClass(this.options.icons.header).toggleClass(this.options.icons.headerSelected);
@ -86,7 +86,7 @@ $.widget("ui.accordion", {
destroy: function() { destroy: function() {
this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role").unbind(".accordion"); this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role").unbind(".accordion");
$.removeData(this.element[0], "accordion"); $.removeData(this.element[0], "accordion");
var groups = this.element.children().removeClass("ui-accordion-group selected"); var groups = this.element.children().removeClass("ui-accordion-group "+this.options.selectedClass);
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") 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"); .removeAttr("role").removeAttr("aria-expanded").removeAttr("tabindex");
headers.find("a").removeAttr("tabindex"); headers.find("a").removeAttr("tabindex");
@ -354,7 +354,7 @@ $.extend($.ui.accordion, {
return this.href.toLowerCase() == location.href.toLowerCase(); return this.href.toLowerCase() == location.href.toLowerCase();
}, },
running: 0, running: 0,
selectedClass: "selected" selectedClass: "ui-accordion-selected"
}, },
animations: { animations: {
slide: function(options, additions) { slide: function(options, additions) {