mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 09:41:24 +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({
|
||||
title: "Edit Marker",
|
||||
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
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -798,6 +798,9 @@ function openSaveTiles() {
|
|||
status.innerHTML = "";
|
||||
let loading = null;
|
||||
|
||||
const inputs = document.getElementById("saveTilesScreen").querySelectorAll("input");
|
||||
inputs.forEach(input => input.addEventListener("input", updateTilesOptions));
|
||||
|
||||
$("#saveTilesScreen").dialog({
|
||||
resizable: false,
|
||||
title: "Download tiles",
|
||||
|
|
@ -819,17 +822,13 @@ function openSaveTiles() {
|
|||
}
|
||||
},
|
||||
close: () => {
|
||||
inputs.forEach(input => input.removeEventListener("input", updateTilesOptions));
|
||||
debug.selectAll("*").remove();
|
||||
clearInterval(loading);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
document
|
||||
.getElementById("saveTilesScreen")
|
||||
.querySelectorAll("input")
|
||||
.forEach(el => el.addEventListener("input", updateTilesOptions));
|
||||
|
||||
function updateTilesOptions() {
|
||||
if (this?.tagName === "INPUT") {
|
||||
const {nextElementSibling: next, previousElementSibling: prev} = this;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue