This commit is contained in:
Azgaar 2020-04-04 00:18:29 +03:00
parent 79e9a12d99
commit aab1b8eac6
12 changed files with 152 additions and 109 deletions

View file

@ -41,8 +41,13 @@ function editUnits() {
function changeDistanceUnit() {
if (this.value === "custom_name") {
const custom = prompt("Provide a custom name for distance unit");
if (custom) this.options.add(new Option(custom, custom, false, true));
prompt("Provide a custom name for a distance unit", {default:""}, custom => {
this.options.add(new Option(custom, custom, false, true));
lock("distanceUnit");
drawScaleBar();
calculateFriendlyGridSize();
});
return;
}
lock("distanceUnit");
@ -69,9 +74,11 @@ function editUnits() {
function changeHeightUnit() {
if (this.value === "custom_name") {
const custom = prompt("Provide a custom name for height unit");
if (custom) this.options.add(new Option(custom, custom, false, true));
else this.value = "ft";
prompt("Provide a custom name for a height unit", {default:""}, custom => {
this.options.add(new Option(custom, custom, false, true));
lock("heightUnit");
});
return;
}
lock("heightUnit");