From 078f31989878b15d0f3d881677070af11bf22f34 Mon Sep 17 00:00:00 2001 From: FabioL Date: Sun, 30 Jun 2024 15:07:26 +0200 Subject: [PATCH] Ottimizzazione apertura riquadro mappa --- modules/interventi/header.php | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/modules/interventi/header.php b/modules/interventi/header.php index 666dac446..d49679f38 100644 --- a/modules/interventi/header.php +++ b/modules/interventi/header.php @@ -244,9 +244,10 @@ if (!empty($sede_cliente->gaddress) || (!empty($sede_cliente->lat) && !empty($se
'; // Navigazione diretta verso l'indirizzo echo ' - - '.tr('Carica mappa').' - +
'; @@ -345,6 +346,16 @@ echo ' var map = null; function caricaMappa() { + const $map_container = $(".module-header:visible .card").eq(2); + + // Ingrandimento area mappa + $map_container.css("height", "300px"); + alignMaxHeight(".module-header .card"); + $("#map-edit").css("height", "80%"); + + $map_container.find(".load").addClass("hidden"); + $map_container.find(".go-to").removeClass("hidden"); + const lat = parseFloat("'.$sede_cliente->lat.'"); const lng = parseFloat("'.$sede_cliente->lng.'"); @@ -393,11 +404,15 @@ echo ' map.setView([lat, lng], 10); } - max_height = 0; - $(".module-header .card").each( function(){ - if($(this).height() > max_height){ - max_height = $(this).height(); - } - }); - $(".module-header .card").height(max_height); + function alignMaxHeight(element){ + max_height = 0; + $(element).each( function(){ + if($(this).height() > max_height){ + max_height = $(this).height(); + } + }); + $(element).height(max_height); + } + + alignMaxHeight(".module-header .card"); ';