Drupal 8 Site using Vue
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
471 B

  1. !((document, Drupal) => {
  2. 'use strict';
  3. Drupal.behaviors.drupalVueCollapsible = {
  4. attach: function(context) {
  5. const collapsibles = context.querySelectorAll('.collapsible-non-vue');
  6. collapsibles.forEach((collapsible) => {
  7. collapsible.querySelector('.title').addEventListener('click', function(e) {
  8. e.preventDefault();
  9. this.parentElement.classList.toggle('closed');
  10. });
  11. });
  12. }
  13. };
  14. })(document, Drupal);