23 lines
564 B
JavaScript
23 lines
564 B
JavaScript
const trinagles = $('.dropdownIndicator');
|
|
console.log(`Found ${trinagles.length} triangles`)
|
|
|
|
|
|
trinagles.each(function () {
|
|
var target = $(this.dataset.refTarget);
|
|
var triTar = $(this);
|
|
// Apply rotate if target is open
|
|
if (target.hasClass('show')) {
|
|
$(this).addClass('rotate');
|
|
}
|
|
|
|
console.log('target', target);
|
|
target.on('show.bs.collapse', function () {
|
|
$(triTar).addClass('rotate');
|
|
$(triTar).removeClass('derotate');
|
|
});
|
|
target.on('hide.bs.collapse', function () {
|
|
$(triTar).removeClass('rotate');
|
|
$(triTar).addClass('derotate');
|
|
});
|
|
});
|