commit 609f592f10c4841171b674a2c8a38bbfcfcc0f7a
parent d39aaab7323e442bcb44cee03c6c6c6aa89d987c
Author: Jacob R. Edwards <jacob@jacobedwards.org>
Date: Mon, 14 Oct 2024 13:11:27 -0700
Use #selOps more appropriately
Put all selection operations in it.
Diffstat:
2 files changed, 7 insertions(+), 11 deletions(-)
diff --git a/files/floorplans/floorplan/main.css b/files/floorplans/floorplan/main.css
@@ -40,6 +40,7 @@ header > .toolbar > li {
#selOps > * {
margin: 0 .5em;
+ display: inline;
}
svg {
diff --git a/files/floorplans/floorplan/main.js b/files/floorplans/floorplan/main.js
@@ -284,17 +284,6 @@ function selectHandler(event, editor, state) {
)
}
- if (state.maplength) {
- state.maplength.remove()
- delete state.maplength
- }
- if (groups.pntmap && cnt === 1) {
- state.maplength = document.body.querySelector(".toolbar")
- .appendChild(document.createElement("li"))
- state.maplength.appendChild(document.createTextNode("Length: " +
- userLength(editor, editor.pointmapLength(groups.pntmap[0]))))
- }
-
if (groups.pntmap !== undefined || groups.pnt !== undefined) {
const getMaps = function() {
let maps = {}
@@ -337,6 +326,12 @@ function selectHandler(event, editor, state) {
)
}
+ if (groups.pntmap && cnt === 1) {
+ c.appendChild(document.createElement("li"))
+ .appendChild(document.createTextNode("Length: " +
+ userLength(editor, editor.pointmapLength(groups.pntmap[0]))))
+ }
+
if (groups.furmap) {
if (groups.furmap.length !== 1) {
document.querySelectorAll(".furniture_menu").forEach(