mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-22 12:01:23 +01:00
fixed button toggling
This commit is contained in:
parent
49f9486f97
commit
128231144e
1 changed files with 9 additions and 4 deletions
|
|
@ -14,6 +14,7 @@ function overviewMarkers() {
|
||||||
const markersGenerationConfig = document.getElementById("markersGenerationConfig");
|
const markersGenerationConfig = document.getElementById("markersGenerationConfig");
|
||||||
const markersRemoveAll = document.getElementById("markersRemoveAll");
|
const markersRemoveAll = document.getElementById("markersRemoveAll");
|
||||||
const markersExport = document.getElementById("markersExport");
|
const markersExport = document.getElementById("markersExport");
|
||||||
|
const markerTypeInput = document.getElementById("addedMarkerType");
|
||||||
|
|
||||||
addLines();
|
addLines();
|
||||||
|
|
||||||
|
|
@ -25,9 +26,6 @@ function overviewMarkers() {
|
||||||
position: {my: "right top", at: "right-10 top+10", of: "svg", collision: "fit"}
|
position: {my: "right top", at: "right-10 top+10", of: "svg", collision: "fit"}
|
||||||
});
|
});
|
||||||
|
|
||||||
const markerTypeInput = document.getElementById("addedMarkerType");
|
|
||||||
markerTypeInput.addEventListener("change", toggleAddMarker);
|
|
||||||
|
|
||||||
Markers.getConfig().forEach(markerConfig => {
|
Markers.getConfig().forEach(markerConfig => {
|
||||||
const option = document.createElement("option");
|
const option = document.createElement("option");
|
||||||
option.setAttribute("value", markerConfig.type);
|
option.setAttribute("value", markerConfig.type);
|
||||||
|
|
@ -43,7 +41,8 @@ function overviewMarkers() {
|
||||||
listen(markersAddFromOverview, "click", toggleAddMarker),
|
listen(markersAddFromOverview, "click", toggleAddMarker),
|
||||||
listen(markersGenerationConfig, "click", configMarkersGeneration),
|
listen(markersGenerationConfig, "click", configMarkersGeneration),
|
||||||
listen(markersRemoveAll, "click", triggerRemoveAll),
|
listen(markersRemoveAll, "click", triggerRemoveAll),
|
||||||
listen(markersExport, "click", exportMarkers)
|
listen(markersExport, "click", exportMarkers),
|
||||||
|
listen(markerTypeInput, "change", changeMarkerType),
|
||||||
];
|
];
|
||||||
|
|
||||||
function handleLineClick(ev) {
|
function handleLineClick(ev) {
|
||||||
|
|
@ -154,6 +153,12 @@ function overviewMarkers() {
|
||||||
addMarker.click();
|
addMarker.click();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function changeMarkerType() {
|
||||||
|
if (!markersAddFromOverview.classList.contains("pressed")) {
|
||||||
|
toggleAddMarker();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function removeMarker(i) {
|
function removeMarker(i) {
|
||||||
notes = notes.filter(note => note.id !== `marker${i}`);
|
notes = notes.filter(note => note.id !== `marker${i}`);
|
||||||
pack.markers = pack.markers.filter(marker => marker.i !== i);
|
pack.markers = pack.markers.filter(marker => marker.i !== i);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue