montpellier: add roadworks css/js (#73652)

This commit is contained in:
Frédéric Péters 2023-01-20 15:54:07 +01:00 committed by Gitea
parent 3f0215c179
commit cdd717133c
5 changed files with 49 additions and 4 deletions

View File

@ -1,5 +1,6 @@
$cell-map-height: calc(100vh - 265px);
$cell-map-mobile-height: calc(100vh - 108px);
$cell-map-height: calc(100vh - 265px) !default;
$cell-map-mobile-height: calc(100vh - 108px) !default;
$roadwork-width: 400px !default;
.page-template-roadworks-map {
#main-content {
@ -42,8 +43,8 @@ $cell-map-mobile-height: calc(100vh - 108px);
height: calc(#{$cell-map-height} + 2px);
overflow-x: hidden;
overflow-y: scroll;
width: 25vw;
transform: translateX(25vw);
width: $roadwork-width;
transform: translateX($roadwork-width);
transition: transform linear 250ms;
padding: 1em;
h3 {

View File

@ -978,3 +978,22 @@ p#help {
text-align: right;
margin-bottom: 0;
}
.page-template-roadworks-map {
.leaflet-marker-icon {
font-size: 16px;
}
.chantier .chantier--libelle {
color: #666;
}
.chantier {
padding: 0;
> h3 {
padding: 0.5rem 1rem;
font-size: 110%;
}
> div {
padding: 0 1rem;
}
}
}

View File

@ -42,3 +42,5 @@ $wcs-steps-spacing: 0.7rem;
$wcs-step-background: #fbfbfb;
$or-separator: false;
$cell-map-mobile-height: calc(100vh - 198px);

View File

@ -59,4 +59,26 @@ $(function() {
$(this).parent().toggleClass('on');
return false;
});
$('.page-template-roadworks-map div.cell.map').on('combo:map-feature-prepare', function(ev, info) {
info.layer.on('click', function(ev) {
var marker = info.layer;
var chantier_id = marker.feature.properties.IDCHANTIER || marker.feature.properties.id;
var $cell = $('[data-chantier-id=' + chantier_id + ']');
if ($cell.hasClass('shown')) {
$('.chantier').removeClass('shown');
} else {
$('.chantier[data-chantier-id!=' + chantier_id + ']').removeClass('shown');
$('.chantier').show();
$cell.addClass('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');
}
});

View File

@ -16,5 +16,6 @@
@import '../includes/back-top';
@import '../includes/library';
@import '../includes/authentic';
@import '../montpellier-ville/chantiers';
@import 'custom';