Skip to content

Commit

Permalink
feat(accordion): allow custom panel class
Browse files Browse the repository at this point in the history
* add support for custom panel class

fixes angular-ui#3968
  • Loading branch information
icfantv committed Aug 21, 2015
1 parent 9823be9 commit 1c29276
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/accordion/docs/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The body of each accordion group is transcluded in to the body of the collapsibl

### Accordion Group Settings ###

* `panel-class` (Defaults: `default`) :
Add ability to use Bootstrap's contextual panel classes (primary, success, info, etc...) or your own. This must be a string.
* `panel-class` (Defaults: `panel-default`) :
Add ability to use Bootstrap's contextual panel classes (panel-primary, panel-success, panel-info, etc...) or your own. This must be a string.
* `template-url` (Defaults: `template/accordion/accordion-group.html`) :
Add ability to override the template url used. Note that this must be a string
4 changes: 2 additions & 2 deletions src/accordion/test/accordion.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -541,10 +541,10 @@ describe('accordion', function() {
});

it('should use the specified value when not falsy', function() {
element = $compile('<accordion><accordion-group heading="Heading" panel-class="success">Content</accordion-group></accordion>')(scope);
element = $compile('<accordion><accordion-group heading="Heading" panel-class="custom-class">Content</accordion-group></accordion>')(scope);
scope.$digest();
groups = element.find('.panel');
expect(groups.eq(0)).toHaveClass('panel-success');
expect(groups.eq(0)).toHaveClass('custom-class');
expect(groups.eq(0)).not.toHaveClass('panel-default');
});
});
Expand Down
2 changes: 1 addition & 1 deletion template/accordion/accordion-group.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="panel panel-{{panelClass || 'default'}}">
<div class="panel {{panelClass || 'panel-default'}}">
<div class="panel-heading">
<h4 class="panel-title">
<a href tabindex="0" class="accordion-toggle" ng-click="toggleOpen()" accordion-transclude="heading"><span ng-class="{'text-muted': isDisabled}">{{heading}}</span></a>
Expand Down

0 comments on commit 1c29276

Please sign in to comment.