Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable clicking on an accordion group heading?

This is a cut down version of the accordion example here.

  <accordion>
    <accordion-group heading="Static Header">
      This content is straight in the template.
    </accordion-group>
  </accordion>

How is it possible to disable clicking on the accordion group heading. I tried ng-disabled=true on the accordion element and the accordion-group element but it does not work.

like image 624
camden_kid Avatar asked Mar 20 '14 10:03

camden_kid


1 Answers

According to the source there is an isDisabled property on the accordeon group, which is used in the toggle function. This should be the way to disable a panel.

https://github.com/angular-ui/bootstrap/blob/master/src/accordion/accordion.js

The toggle function:

scope.toggleOpen = function() {
 if ( !scope.isDisabled ) {
     scope.isOpen = !scope.isOpen;
 }
};

edit: this is not part of the 0.10 version you are using, so you have to get the main version, or make the change yourself.

like image 52
Tim Avatar answered Sep 24 '22 20:09

Tim