collapser-controller.js 455 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.classList.remove("fa-rotate-90");
  7. });
  8. this.collapseTarget.addEventListener ('show.bs.collapse', () => {
  9. this.buttonTarget.classList.add("fa-rotate-90");
  10. })
  11. }
  12. }