Skip to content

Commit

Permalink
accordion: updated to icons: { header, headerSelected }
Browse files Browse the repository at this point in the history
  • Loading branch information
jzaefferer committed Dec 22, 2008
1 parent 36095fd commit 47938b3
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions ui/ui.accordion.js
Expand Up @@ -39,8 +39,8 @@ $.widget("ui.accordion", {


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("selected");
$("<span/>").addClass("ui-icon " + this.options.headerIcon).prependTo(headers); $("<span/>").addClass("ui-icon " + this.options.icons.header).prependTo(headers);
active.find(".ui-icon").toggleClass(this.options.headerIcon).toggleClass(this.options.headerIconSelected); active.find(".ui-icon").toggleClass(this.options.icons.header).toggleClass(this.options.icons.headerSelected);


// IE7-/Win - Extra vertical space in Lists fixed // IE7-/Win - Extra vertical space in Lists fixed
if ($.browser.msie) { if ($.browser.msie) {
Expand Down Expand Up @@ -297,11 +297,11 @@ function clickHandler(event) {
// switch classes // switch classes
options.active.parent().toggleClass(options.selectedClass); options.active.parent().toggleClass(options.selectedClass);
options.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all") options.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all")
.find(".ui-icon").removeClass(options.headerIconSelected).addClass(options.headerIcon); .find(".ui-icon").removeClass(options.icons.headerSelected).addClass(options.icons.header);
if ( !clickedActive ) { if ( !clickedActive ) {
clicked.parent().addClass(options.selectedClass); clicked.parent().addClass(options.selectedClass);
clicked.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top") clicked.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top")
.find(".ui-icon").removeClass(options.headerIcon).addClass(options.headerIconSelected); .find(".ui-icon").removeClass(options.icons.header).addClass(options.icons.headerSelected);
} }


// find elements to show and hide // find elements to show and hide
Expand Down Expand Up @@ -340,8 +340,10 @@ $.extend($.ui.accordion, {
animated: 'slide', animated: 'slide',
event: "click", event: "click",
header: "a", header: "a",
headerIcon: "ui-icon-triangle-1-e", icons: {
headerIconSelected: "ui-icon-triangle-1-s", header: "ui-icon-triangle-1-e",
headerSelected: "ui-icon-triangle-1-s"
},
navigationFilter: function() { navigationFilter: function() {
return this.href.toLowerCase() == location.href.toLowerCase(); return this.href.toLowerCase() == location.href.toLowerCase();
}, },
Expand Down

0 comments on commit 47938b3

Please sign in to comment.