www.spaceplanner.app

Web client to the spaceplanner API
git clone git://jacobedwards.org/www.spaceplanner.app
Log | Files | Refs

commit 9118730edbe01988e7bfb821e4d1e71492511213
parent 51ffea8d61d1201505d447bd250e500e1dd396a8
Author: Jacob R. Edwards <jacob@jacobedwards.org>
Date:   Fri, 23 Aug 2024 15:23:19 -0700

Fix handler order and minutia

Diffstat:
Mfiles/floorplans/floorplan/main.js | 15++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/files/floorplans/floorplan/main.js b/files/floorplans/floorplan/main.js @@ -175,7 +175,7 @@ let modes = { mousedown: precisePointHandler, mousemove: precisePointHandler, mouseup: precisePointHandler, - keydown: [zoomKeysHandler, undoRedoHandler, precisePointHandler, pointMapTypeHandler], + keydown: [zoomKeysHandler, undoRedoHandler, pointMapTypeHandler, precisePointHandler], click: [precisePointHandler, pointMapTypeHandler], dblclick: precisePointHandler, } @@ -241,8 +241,14 @@ function pointMapTypeHandler(event, editor, state) { cancel() } - let map = editor.thingAt(editor.draw.point(event.clientX, event.clientY), "#floorplan > *") - if (!map || map.type != "line") { + let cursor = editor.draw.point(event.clientX, event.clientY) + let point = editor.thingAt(cursor, "#points") + if (point) { + return + } + + let map = editor.thingAt(cursor, "#pointmaps") + if (!map) { return } @@ -554,6 +560,9 @@ function preciseEditPointHandler(event, editor, state) { } if (event.type === "dblclick") { + if (state.menu) { + cleanup() + } state.done = false state.point = point state.menu = document.createElement("li")