From 538ddd76e99d3a3e68367119b86ebf018f86cc15 Mon Sep 17 00:00:00 2001 From: Kumi Date: Thu, 28 Mar 2024 11:33:34 +0100 Subject: [PATCH] feat(editor): introduce debug mode for element properties Wrapped element creation and modification properties sections in a div with a `hide` class, which can now be toggled via a keyboard shortcut (Ctrl+Shift+Q). This debug mode allows developers to easily view and hide debugging information about elements being created or modified in the editor. This enhancement is aimed at improving the development and troubleshooting process by providing quick access to relevant debug information without cluttering the UI for users. Additionally, a new function `toggleDebugVisibility` was added to manage the visibility of debug information, and a keyboard event listener was implemented to handle the specified keyboard shortcut. This update aims to balance the need for detailed debugging information during development with a clean, user-friendly interface during regular use. --- assets/js/editor.js | 44 +++++++++++++++++++++++++++++++------------- 1 file changed, 31 insertions(+), 13 deletions(-) diff --git a/assets/js/editor.js b/assets/js/editor.js index 328ad3d..66e0676 100644 --- a/assets/js/editor.js +++ b/assets/js/editor.js @@ -55,15 +55,18 @@ function startCreateElement(event) { event.detail.intersection.point.z ); - propertiesContent.innerHTML = `Creating element at:
- X: ${event.detail.intersection.point.x}
- Y: ${event.detail.intersection.point.y}
- Z: ${event.detail.intersection.point.z}
- Calculated Theta: ${thetaStart}
+ propertiesContent.innerHTML = ` +
+ Creating element at:
+ X: ${event.detail.intersection.point.x}
+ Y: ${event.detail.intersection.point.y}
+ Z: ${event.detail.intersection.point.z}
+ Calculated Theta: ${thetaStart}
+ + Parent Element Type: ${event.srcElement.tagName}
+
+
- Parent Element Type: ${event.srcElement.tagName}
-
-