mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-16 17:31:24 +01:00
Update script.js
196 fix
This commit is contained in:
parent
97eea31488
commit
d1124c600b
1 changed files with 4 additions and 2 deletions
|
|
@ -2455,8 +2455,10 @@ function fantasyMap() {
|
||||||
}
|
}
|
||||||
let group = this.value.toLowerCase().replace(/ /g, "_").replace(/[^\w\s]/gi, "");
|
let group = this.value.toLowerCase().replace(/ /g, "_").replace(/[^\w\s]/gi, "");
|
||||||
if (Number.isFinite(+group.charAt(0))) group = "g" + group;
|
if (Number.isFinite(+group.charAt(0))) group = "g" + group;
|
||||||
// if el with this id exists, add size to id
|
if (d3.selectAll("#"+group).size()) {
|
||||||
while (labels.selectAll("#"+group).size()) {group += "_new";}
|
tip("Element with this id already exists. Please provide a unique name");
|
||||||
|
return;
|
||||||
|
}
|
||||||
createNewLabelGroup(group);
|
createNewLabelGroup(group);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue