collapser-controller.js 517 B

12345678910111213
  1. import { Controller } from '@hotwired/stimulus';
  2. export default class extends Controller {
  3. static targets = ['collapse', 'button']
  4. connect() {
  5. this.collapseTarget.addEventListener ('hide.bs.collapse', () => {
  6. this.buttonTarget.innerHTML = '<i class="fa fa-chevron-circle-right fa-lg"></i>';
  7. });
  8. this.collapseTarget.addEventListener ('show.bs.collapse', () => {
  9. this.buttonTarget.innerHTML = '<i class="fa fa-chevron-circle-down fa-lg"></i>';
  10. })
  11. }
  12. }