montpellier: add toggling event to roadworks asynchronously loaded (#73552)

This commit is contained in:
Frédéric Péters 2023-01-18 13:13:22 +01:00 committed by Gitea
parent 9ac5c2baaa
commit c5c98e62a0
1 changed files with 6 additions and 1 deletions

View File

@ -13,5 +13,10 @@ $(function() {
} }
}); });
}); });
$('.chantier').on('click', function() { $(this).toggleClass('shown'); }); if ($('.page-template-roadworks-map').length) {
$(document).on('combo:cell-loaded combo:roadworks-loaded', function(ev, elem) {
$('.chantier').off('click').on('click', function() { $(this).toggleClass('shown'); });
});
$(document).trigger('combo:roadworks-loaded');
}
}); });