assetflow/static/js/handleSidebarTriangles.js
2023-05-21 00:42:37 +02:00

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');
});
});