diff --git a/src/accordion/accordion.js b/src/accordion/accordion.js
index cb5c0b858d..1366fc1473 100644
--- a/src/accordion/accordion.js
+++ b/src/accordion/accordion.js
@@ -79,7 +79,9 @@ angular.module('ui.bootstrap.accordion', ['ui.bootstrap.collapse'])
link: function(scope, element, attrs, accordionCtrl) {
accordionCtrl.addGroup(scope);
+ scope.openClass = attrs.openClass || 'panel-open';
scope.$watch('isOpen', function(value) {
+ element.toggleClass(scope.openClass, value);
if (value) {
accordionCtrl.closeOthers(scope);
}
diff --git a/src/accordion/test/accordion.spec.js b/src/accordion/test/accordion.spec.js
index b3fcd94a52..fc4f0ecabd 100644
--- a/src/accordion/test/accordion.spec.js
+++ b/src/accordion/test/accordion.spec.js
@@ -212,7 +212,7 @@ describe('accordion', function() {
expect(findGroupBody(0).scope().isOpen).toBe(false);
});
- it('should add "open" when opened', function() {
+ it('should add, by default, "panel-open" when opened', function() {
var group = groups.eq(0);
findGroupLink(0).click();
scope.$digest();
@@ -224,6 +224,34 @@ describe('accordion', function() {
});
});
+ describe('with open-class attribute', function() {
+ beforeEach(function() {
+ var tpl =
+ '