aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJörn Zaefferer <joern.zaefferer@gmail.com>2008-12-14 11:45:24 +0000
committerJörn Zaefferer <joern.zaefferer@gmail.com>2008-12-14 11:45:24 +0000
commit187268ef7974e9e086d19a0f2e623f3287aade37 (patch)
treef8f88ec7f328474e8e8eec81bbae7178f1dd9276
parentff64790b183a72cfebf2ecd0d91a3ac53160a57c (diff)
downloadjquery-ui-187268ef7974e9e086d19a0f2e623f3287aade37.tar.gz
jquery-ui-187268ef7974e9e086d19a0f2e623f3287aade37.zip
accordion: #3646 update - expose icons as headerIcon and headerIconSelected options
-rw-r--r--ui/ui.accordion.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/ui/ui.accordion.js b/ui/ui.accordion.js
index 307264946..6f46d6881 100644
--- a/ui/ui.accordion.js
+++ b/ui/ui.accordion.js
@@ -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");
active.parent().addClass("selected");
- $("<span/>").addClass("ui-icon ui-icon-triangle-1-e").prependTo(headers);
- active.find(".ui-icon").toggleClass("ui-icon-triangle-1-e").toggleClass("ui-icon-triangle-1-s");
+ $("<span/>").addClass("ui-icon " + this.options.headerIcon).prependTo(headers);
+ active.find(".ui-icon").toggleClass(this.options.headerIcon).toggleClass(this.options.headerIconSelected);
// IE7-/Win - Extra vertical space in Lists fixed
if ($.browser.msie) {
@@ -297,11 +297,11 @@ function clickHandler(event) {
// switch classes
options.active.parent().toggleClass(options.selectedClass);
options.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all")
- .find(".ui-icon").removeClass("ui-icon-triangle-1-s").addClass("ui-icon-triangle-1-e");
+ .find(".ui-icon").removeClass(options.headerIconSelected).addClass(options.headerIcon);
if ( !clickedActive ) {
clicked.parent().addClass(options.selectedClass);
clicked.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top")
- .find(".ui-icon").removeClass("ui-icon-triangle-1-e").addClass("ui-icon-triangle-1-s");
+ .find(".ui-icon").removeClass(options.headerIcon).addClass(options.headerIconSelected);
}
// find elements to show and hide
@@ -340,6 +340,8 @@ $.extend($.ui.accordion, {
animated: 'slide',
event: "click",
header: "a",
+ headerIcon: "ui-icon-triangle-1-e",
+ headerIconSelected: "ui-icon-triangle-1-s",
navigationFilter: function() {
return this.href.toLowerCase() == location.href.toLowerCase();
},