Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Commit

Permalink
fix(accordion): fix unexpected routing
Browse files Browse the repository at this point in the history
- Change anchor tag to `div` to prevent anchor tag from triggering route change

BREAKING CHANGE: This causes the cursor style to be removed from the heading - implement CSS on the `accordion-toggle` class accordingly

Closes #4792
  • Loading branch information
wesleycho committed Oct 31, 2015
1 parent 0495ff0 commit df211bd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/accordion/docs/demo.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
<style>
.accordion-toggle {
cursor: pointer;
}
</style>

<div ng-controller="AccordionDemoCtrl">
<script type="text/ng-template" id="group-template.html">
<div class="panel {{panelClass || 'panel-default'}}">
Expand Down
2 changes: 1 addition & 1 deletion src/accordion/test/accordion.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ describe('uib-accordion', function() {
var scope, $compile;
var element, groups;
var findGroupLink = function(index) {
return groups.eq(index).find('a').eq(0);
return groups.eq(index).find('.accordion-toggle').eq(0);
};
var findGroupBody = function(index) {
return groups.eq(index).find('.panel-collapse').eq(0);
Expand Down
2 changes: 1 addition & 1 deletion template/accordion/accordion-group.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="panel {{panelClass || 'panel-default'}}">
<div class="panel-heading" ng-keypress="toggleOpen($event)">
<h4 class="panel-title">
<a href tabindex="0" class="accordion-toggle" ng-click="toggleOpen()" uib-accordion-transclude="heading"><span ng-class="{'text-muted': isDisabled}">{{heading}}</span></a>
<div tabindex="0" class="accordion-toggle" ng-click="toggleOpen()" uib-accordion-transclude="heading"><span ng-class="{'text-muted': isDisabled}">{{heading}}</span></div>
</h4>
</div>
<div class="panel-collapse collapse" uib-collapse="!isOpen">
Expand Down

0 comments on commit df211bd

Please sign in to comment.