From 4c902184903dfb4e4514ee3d491cf9521d4322e2 Mon Sep 17 00:00:00 2001 From: Kumi Date: Thu, 28 Mar 2024 11:26:24 +0100 Subject: [PATCH] feat(editor): enhance element property forms Refined the `createElementPropertiesForm` in the editor to include position and rotation inputs, improving user interaction for specifying these attributes. Simplified the function's parameters by removing unnecessary event and thetaStart arguments, streamlining the codebase. Also corrected the naming of `destination_x`, `destination_y`, and `destination_z` input names for consistency. Marked handling of unknown element types with a TODO to prompt future development. This enhancement allows for more precise control over element positioning and orientation, directly impacting user experience positively. --- assets/js/editor.js | 47 ++++++++++++++++++++++++++++++++++----------- 1 file changed, 36 insertions(+), 11 deletions(-) diff --git a/assets/js/editor.js b/assets/js/editor.js index 900dcee..328ad3d 100644 --- a/assets/js/editor.js +++ b/assets/js/editor.js @@ -90,7 +90,7 @@ function startCreateElement(event) { }); } -function createElementPropertiesForm(elementType, event, thetaStart) { +function createElementPropertiesForm(elementType) { const elementProperties = document.getElementById("elementProperties"); let inputFields = ""; @@ -102,7 +102,36 @@ function createElementPropertiesForm(elementType, event, thetaStart) {
-
`; + +
+ +
+
+ +
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+ `; if (elementType !== "MarkerElement") { inputFields += `
@@ -125,13 +154,13 @@ function createElementPropertiesForm(elementType, event, thetaStart) {
- +
- +
- +
@@ -140,7 +169,7 @@ function createElementPropertiesForm(elementType, event, thetaStart) { } break; default: - // Handle unknown element type + // TODO: Handle unknown element type } elementProperties.innerHTML = inputFields; @@ -184,11 +213,7 @@ function startModifyElement(event) { `; - createElementPropertiesForm( - element_data.obj.resourcetype, - event, - element_data.obj.thetaStart - ); + createElementPropertiesForm(element_data.obj.resourcetype); var scene_data_request = getScene(scene.getAttribute("id")); scene_data_request.then((scene_data) => {