Request read/write persmissions, don't place markers outside of edit mode

This commit is contained in:
Antonia 2025-03-10 22:00:06 +01:00
parent f3b2c0245c
commit 209eb3c7c2

View file

@ -117,9 +117,9 @@ async function updateBrouter () {
} }
map.on('click', function(e) { map.on('click', function(e) {
// if (!editMode) { if (!editMode) {
// return; return;
// } }
marker = new L.marker(e.latlng, {draggable: true}) ; marker = new L.marker(e.latlng, {draggable: true}) ;
markers.push(marker); markers.push(marker);
marker.on("click", function(e) { marker.on("click", function(e) {
@ -139,7 +139,7 @@ async function pickDirectory(e){
e.stopPropagation() e.stopPropagation()
L.DomEvent.preventDefault(e); L.DomEvent.preventDefault(e);
if (!editMode) { if (!editMode) {
dirHandle = await window.showDirectoryPicker(); dirHandle = await window.showDirectoryPicker({ mode: 'readwrite' });
for (i = 0; i < l.length ; i++ ) { for (i = 0; i < l.length ; i++ ) {
console.log(l[i].dirname); console.log(l[i].dirname);
if (l[i].dirname === dirHandle.name) { if (l[i].dirname === dirHandle.name) {