So I’m trying to capture whenever a static content item collapses or expands.
I created a dynamic action on the SC (triggered whenever the SC is clicked) with the following JavaScript:
if (this.browserEvent.target.classList.contains("t-Region-titleButton")) {
if (this.triggeringElement.classList.contains("is-expanded")) {
console.log("Expanded");
} else {
console.log("Collapsed");
}
}
It works, but maybe somebody here has a better (and cleaner) solution. Any help/tip would be welcome. 🙂
Thanks!
New contributor
Julio Almeida is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.