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

!((document, Drupal) => {
'use strict';
Drupal.behaviors.drupalVueCollapsible = {
attach: function(context) {
const collapsibles = context.querySelectorAll('.collapsible-non-vue');
collapsibles.forEach((collapsible) => {
collapsible.querySelector('.title').addEventListener('click', function(e) {
e.preventDefault();
this.parentElement.classList.toggle('closed');
});
});
}
};
})(document, Drupal);