enable and disable map on modal open/close

This commit is contained in:
HB9HIL
2024-09-19 10:29:24 +02:00
parent 8ffea2e15a
commit aee24f17f1
3 changed files with 30 additions and 3 deletions

View File

@@ -158,6 +158,9 @@ function isMarkerInsidePolygon(marker, poly) {
}
function onMapClick(event) {
if ($('.modal-dialog')[0]) {
return;
}
var LatLng = event.latlng;
var lat = LatLng.lat;
var lng = LatLng.lng;

View File

@@ -1123,6 +1123,26 @@ function newpath(latlng1, latlng2, locator1, locator2) {
}).addTo(map);
}
function disableMap() {
console.log('disable map')
map.dragging.disable();
map.scrollWheelZoom.disable();
map.touchZoom.disable();
map.doubleClickZoom.disable();
map.boxZoom.disable();
map.keyboard.disable();
}
function enableMap() {
console.log('enable map')
map.dragging.enable();
map.scrollWheelZoom.enable();
map.touchZoom.enable();
map.doubleClickZoom.enable();
map.boxZoom.enable();
map.keyboard.enable();
}
console.log("Ready to unleash your coding prowess and join the fun?\n\n" +
"Check out our GitHub Repository and dive into the coding adventure:\n\n" +
"🚀 https://www.github.com/wavelog/wavelog");

View File

@@ -161,7 +161,7 @@ function spawnGridsquareModal(loc_4char) {
success: function (html) {
var dialog = new BootstrapDialog({
title: lang_general_word_qso_data,
cssClass: 'qso-dialog',
cssClass: 'qso-dialog bg-black bg-opacity-50',
size: BootstrapDialog.SIZE_WIDE,
nl2br: false,
message: html,
@@ -192,6 +192,9 @@ function spawnGridsquareModal(loc_4char) {
showQsoActionsMenu($(this).closest('.dropdown'));
});
},
onhide: function(dialog) {
enableMap();
},
buttons: [{
label: lang_admin_close,
action: function(dialogItself) {
@@ -200,9 +203,10 @@ function spawnGridsquareModal(loc_4char) {
}]
});
dialog.realize();
$("body").append(dialog.getModal());
$('#gridsquare_map').append(dialog.getModal());
disableMap();
dialog.open();
},
},
error: function(e) {
modalloading=false;
}