mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 01:41:22 +01:00
saveTiles clean up listeners on close
This commit is contained in:
parent
2587a1643b
commit
3dea76777b
2 changed files with 5 additions and 6 deletions
|
|
@ -32,7 +32,7 @@ function editMarker() {
|
||||||
$("#markerEditor").dialog({
|
$("#markerEditor").dialog({
|
||||||
title: "Edit Marker",
|
title: "Edit Marker",
|
||||||
resizable: false,
|
resizable: false,
|
||||||
position: {my: "center top+30", at: "bottom", of: element, collision: "fit"},
|
position: {my: "left top", at: "left+10 top+10", of: "svg", collision: "fit"},
|
||||||
close: closeMarkerEditor
|
close: closeMarkerEditor
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -798,6 +798,9 @@ function openSaveTiles() {
|
||||||
status.innerHTML = "";
|
status.innerHTML = "";
|
||||||
let loading = null;
|
let loading = null;
|
||||||
|
|
||||||
|
const inputs = document.getElementById("saveTilesScreen").querySelectorAll("input");
|
||||||
|
inputs.forEach(input => input.addEventListener("input", updateTilesOptions));
|
||||||
|
|
||||||
$("#saveTilesScreen").dialog({
|
$("#saveTilesScreen").dialog({
|
||||||
resizable: false,
|
resizable: false,
|
||||||
title: "Download tiles",
|
title: "Download tiles",
|
||||||
|
|
@ -819,17 +822,13 @@ function openSaveTiles() {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
close: () => {
|
close: () => {
|
||||||
|
inputs.forEach(input => input.removeEventListener("input", updateTilesOptions));
|
||||||
debug.selectAll("*").remove();
|
debug.selectAll("*").remove();
|
||||||
clearInterval(loading);
|
clearInterval(loading);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
document
|
|
||||||
.getElementById("saveTilesScreen")
|
|
||||||
.querySelectorAll("input")
|
|
||||||
.forEach(el => el.addEventListener("input", updateTilesOptions));
|
|
||||||
|
|
||||||
function updateTilesOptions() {
|
function updateTilesOptions() {
|
||||||
if (this?.tagName === "INPUT") {
|
if (this?.tagName === "INPUT") {
|
||||||
const {nextElementSibling: next, previousElementSibling: prev} = this;
|
const {nextElementSibling: next, previousElementSibling: prev} = this;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue