diff --git a/assets/js/editor.js b/assets/js/editor.js index 66e0676..0d1ea9f 100644 --- a/assets/js/editor.js +++ b/assets/js/editor.js @@ -30,7 +30,6 @@ function addEventListeners(element) { element.addEventListener("mouseup", function (event) { if (event.timeStamp - clickTimestamp > 200) { // Ignoring this, we only handle regular short clicks. - // TODO: Find a way to handle drags of elements return; } else { handleClick(event); @@ -73,7 +72,7 @@ function startCreateElement(event) { - + `; + var scene = findParentScene(event.target); + var scene_data_request = getScene(scene.getAttribute("id")); + document.getElementById("resetButton").classList.remove("hide"); document.getElementById("buttons").classList.remove("hide"); @@ -90,6 +92,14 @@ function startCreateElement(event) { .addEventListener("change", function () { var selectedType = document.getElementById("resourcetype").value; createElementPropertiesForm(selectedType, event, thetaStart); + + scene_data_request.then((scene_data) => { + var category_data_request = getCategory(scene_data.obj.category); + + category_data_request.then((category_data) => { + populateDestinationDropdown(null, category_data); + }); + }); }); } @@ -120,20 +130,6 @@ function createElementPropertiesForm(elementType) { -
- -
-
- -
-
- -
-
- -
-
-
`; if (elementType !== "MarkerElement") { inputFields += ` @@ -144,30 +140,30 @@ function createElementPropertiesForm(elementType) { } if (elementType === "TeleportElement") { inputFields += ` -