mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 09:41:24 +01:00
v1.4.33
This commit is contained in:
parent
7fa056fe98
commit
361b66a186
4 changed files with 15 additions and 3 deletions
|
|
@ -61,6 +61,7 @@ function moved() {
|
|||
|
||||
// show note box on hover (if any)
|
||||
function showNotes(e, i) {
|
||||
if (notesEditor.offsetParent) return;
|
||||
let id = e.target.id || e.target.parentNode.id || e.target.parentNode.parentNode.id;
|
||||
if (e.target.parentNode.parentNode.id === "burgLabels") id = "burg" + e.target.dataset.id; else
|
||||
if (e.target.parentNode.parentNode.id === "burgIcons") id = "burg" + e.target.dataset.id;
|
||||
|
|
@ -70,7 +71,7 @@ function showNotes(e, i) {
|
|||
document.getElementById("notes").style.display = "block";
|
||||
document.getElementById("notesHeader").innerHTML = note.name;
|
||||
document.getElementById("notesBody").innerHTML = note.legend;
|
||||
} else {
|
||||
} else if (!options.pinNotes) {
|
||||
document.getElementById("notes").style.display = "none";
|
||||
document.getElementById("notesHeader").innerHTML = "";
|
||||
document.getElementById("notesBody").innerHTML = "";
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ function editNotes(id, name) {
|
|||
select.value = id;
|
||||
notesName.value = note.name;
|
||||
notesText.value = note.legend;
|
||||
showNote(note);
|
||||
} else {
|
||||
const value = "There are no added notes. Click on element (e.g. label) and add a free text note";
|
||||
document.getElementById("notesText").value = value;
|
||||
|
|
@ -37,12 +38,19 @@ function editNotes(id, name) {
|
|||
document.getElementById("notesSelect").addEventListener("change", changeObject);
|
||||
document.getElementById("notesName").addEventListener("input", changeName);
|
||||
document.getElementById("notesText").addEventListener("input", changeText);
|
||||
document.getElementById("notesPin").addEventListener("click", () => options.pinNotes = !options.pinNotes);
|
||||
document.getElementById("notesFocus").addEventListener("click", validateHighlightElement);
|
||||
document.getElementById("notesDownload").addEventListener("click", downloadLegends);
|
||||
document.getElementById("notesUpload").addEventListener("click", () => legendsToLoad.click());
|
||||
document.getElementById("legendsToLoad").addEventListener("change", function() {uploadFile(this, uploadLegends)});
|
||||
document.getElementById("notesRemove").addEventListener("click", triggerNotesRemove);
|
||||
|
||||
function showNote(note) {
|
||||
document.getElementById("notes").style.display = "block";
|
||||
document.getElementById("notesHeader").innerHTML = note.name;
|
||||
document.getElementById("notesBody").innerHTML = note.legend;
|
||||
}
|
||||
|
||||
function changeObject() {
|
||||
const note = notes.find(note => note.id === this.value);
|
||||
if (!note) return;
|
||||
|
|
@ -55,6 +63,7 @@ function editNotes(id, name) {
|
|||
const note = notes.find(note => note.id === id);
|
||||
if (!note) return;
|
||||
note.name = this.value;
|
||||
showNote(note);
|
||||
}
|
||||
|
||||
function changeText() {
|
||||
|
|
@ -62,6 +71,7 @@ function editNotes(id, name) {
|
|||
const note = notes.find(note => note.id === id);
|
||||
if (!note) return;
|
||||
note.legend = this.value;
|
||||
showNote(note);
|
||||
}
|
||||
|
||||
function validateHighlightElement() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue