fix button state on handler reset
This commit is contained in:
parent
fbd1d515d3
commit
5154aff553
3 changed files with 51 additions and 0 deletions
|
@ -50,6 +50,24 @@ class MapHandler {
|
|||
}
|
||||
self.map.off("click", MapHandler.polygonAddPoint);
|
||||
} catch {}
|
||||
try {
|
||||
const saveBtn = document.getElementById("save-btn");
|
||||
if (saveBtn) {
|
||||
saveBtn.classList.remove("activeBtn");
|
||||
}
|
||||
} catch {}
|
||||
try {
|
||||
const clearBtn = document.getElementById("clear-btn");
|
||||
if (clearBtn) {
|
||||
clearBtn.classList.remove("activeBtn");
|
||||
}
|
||||
} catch {}
|
||||
try {
|
||||
const menuBtn = document.getElementById("menu-btn");
|
||||
if (menuBtn) {
|
||||
menuBtn.classList.remove("activeBtn");
|
||||
}
|
||||
} catch {}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -198,6 +216,7 @@ class MapHandler {
|
|||
okBtn.onclick = ()=> {
|
||||
OverlayState.save(self.overlays);
|
||||
self.modals.okCancel.setVisible(false);
|
||||
MapHandler.resetMapClick();
|
||||
// show info modal "Save complete"
|
||||
}
|
||||
}
|
||||
|
@ -205,6 +224,7 @@ class MapHandler {
|
|||
if (cancelBtn) {
|
||||
cancelBtn.onclick = () => {
|
||||
self.modals.okCancel.setVisible(false);
|
||||
MapHandler.resetMapClick();
|
||||
}
|
||||
}
|
||||
self.modals.okCancel.setVisible(true);
|
||||
|
@ -223,12 +243,14 @@ class MapHandler {
|
|||
if (okBtn) {
|
||||
okBtn.onclick = ()=> {
|
||||
self.overlays = OverlayState.clear(self.overlays, self.map);
|
||||
MapHandler.resetMapClick();
|
||||
self.modals.okCancel.setVisible(false);
|
||||
}
|
||||
}
|
||||
const cancelBtn = self.modals.okCancel.cancelBtn();
|
||||
if (cancelBtn) {
|
||||
cancelBtn.onclick = () => {
|
||||
MapHandler.resetMapClick();
|
||||
self.modals.okCancel.setVisible(false);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -163,11 +163,13 @@ class TileLayerWrapper {
|
|||
TileLayerWrapper.layers = new Array();
|
||||
class TextUtils {
|
||||
static decodeHTML(text) {
|
||||
return text;
|
||||
const textArea = document.createElement('textarea');
|
||||
textArea.innerHTML = text;
|
||||
return textArea.value;
|
||||
}
|
||||
static encodeHTML(text) {
|
||||
return text;
|
||||
const textArea = document.createElement('textarea');
|
||||
textArea.innerText = text;
|
||||
return textArea.innerHTML;
|
||||
|
@ -414,6 +416,27 @@ class MapHandler {
|
|||
self.map.off("click", MapHandler.polygonAddPoint);
|
||||
}
|
||||
catch (_c) { }
|
||||
try {
|
||||
const saveBtn = document.getElementById("save-btn");
|
||||
if (saveBtn) {
|
||||
saveBtn.classList.remove("activeBtn");
|
||||
}
|
||||
}
|
||||
catch (_d) { }
|
||||
try {
|
||||
const clearBtn = document.getElementById("clear-btn");
|
||||
if (clearBtn) {
|
||||
clearBtn.classList.remove("activeBtn");
|
||||
}
|
||||
}
|
||||
catch (_e) { }
|
||||
try {
|
||||
const menuBtn = document.getElementById("menu-btn");
|
||||
if (menuBtn) {
|
||||
menuBtn.classList.remove("activeBtn");
|
||||
}
|
||||
}
|
||||
catch (_f) { }
|
||||
}
|
||||
}
|
||||
static addMarker(e) {
|
||||
|
@ -547,6 +570,7 @@ class MapHandler {
|
|||
okBtn.onclick = () => {
|
||||
OverlayState.save(self.overlays);
|
||||
self.modals.okCancel.setVisible(false);
|
||||
MapHandler.resetMapClick();
|
||||
// show info modal "Save complete"
|
||||
};
|
||||
}
|
||||
|
@ -554,6 +578,7 @@ class MapHandler {
|
|||
if (cancelBtn) {
|
||||
cancelBtn.onclick = () => {
|
||||
self.modals.okCancel.setVisible(false);
|
||||
MapHandler.resetMapClick();
|
||||
};
|
||||
}
|
||||
self.modals.okCancel.setVisible(true);
|
||||
|
@ -570,12 +595,14 @@ class MapHandler {
|
|||
if (okBtn) {
|
||||
okBtn.onclick = () => {
|
||||
self.overlays = OverlayState.clear(self.overlays, self.map);
|
||||
MapHandler.resetMapClick();
|
||||
self.modals.okCancel.setVisible(false);
|
||||
};
|
||||
}
|
||||
const cancelBtn = self.modals.okCancel.cancelBtn();
|
||||
if (cancelBtn) {
|
||||
cancelBtn.onclick = () => {
|
||||
MapHandler.resetMapClick();
|
||||
self.modals.okCancel.setVisible(false);
|
||||
};
|
||||
}
|
||||
|
|
|
@ -222,6 +222,8 @@ button.negative-btn:hover {
|
|||
z-index: 10;
|
||||
color: white;
|
||||
padding: 0.5em;
|
||||
width: 100%;
|
||||
max-width: fit-content;
|
||||
}
|
||||
|
||||
#import-export-container {
|
||||
|
|
Loading…
Reference in a new issue