diff --git a/static/montpellier-ville/extra.js b/static/montpellier-ville/extra.js index cec089a5..a958d8b8 100644 --- a/static/montpellier-ville/extra.js +++ b/static/montpellier-ville/extra.js @@ -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'); + } });