jQuery(function($) {
function fixEmploymentPanel(panel) {
var $panel = $(panel);
// Force the collapse to take full height and not animate back
$panel.css({
height: 'auto',
maxHeight: 'none',
overflow: 'visible'
});
// Let Elementor / Swiper / gallery scripts recalc
$(window).trigger('resize');
window.dispatchEvent(new Event('resize'));
}
// When a collapse inside our employment accordion **finishes opening**
$('.rts-accordion.employment-accordion .accordion-collapse').on('shown.bs.collapse', function () {
fixEmploymentPanel(this);
});
// Safety: if one starts out open on page load, fix it after load as well
setTimeout(function () {
$('.rts-accordion.employment-accordion .accordion-collapse.show').each(function () {
fixEmploymentPanel(this);
});
}, 800);
});