diff --git a/js/cam/assemblers/Component.js b/js/cam/assemblers/Component.js index 4579565af71b4aa8d56f7377c2a70661f5270214..a16e4181bae69d9b336e6a6fe7e9cbc87d810a8d 100644 --- a/js/cam/assemblers/Component.js +++ b/js/cam/assemblers/Component.js @@ -157,17 +157,17 @@ define(['underscore', 'cam', 'three'], function(_, cam, THREE){ Component.prototype.toJSON = function(){ - var childIds = []; + var childIDs = []; _.each(this.children, function(child){ - childIds.push(child.id); + childIDs.push(child.id); }); - var parentName = ""; - if (this.parent) parentName = this.parent.name; + var parentID = ""; + if (this.parent) parentID = this.parent.id; return { id: this.id, name: this.name, - children: childIds, - parent: parentName, + children: childIDs, + parent: parentID, translation: this.object3D.position, scale: this.object3D.scale.x, rotation: this.object3D.rotation diff --git a/js/menus/templates/EditComponentMenuView.html b/js/menus/templates/EditComponentMenuView.html index 79c7232ca5b8bd894cb0981b202cb0ada23bc4e2..eac946eea6f0d6f5a0dd59970d0253c98ccc3993 100644 --- a/js/menus/templates/EditComponentMenuView.html +++ b/js/menus/templates/EditComponentMenuView.html @@ -1,7 +1,7 @@ Name: <input data-property="name" value="<%= components[editingComponent].name %>" placeholder="Enter Name" class="seventyFiveWidth form-control textInput component" type="text"><br/><br/> Parent: <div class="btn-group"> - <button data-toggle="dropdown" class="btn dropdown-toggle" type="button"><%= components[editingComponent].parent || "No Parent Selected" %><span class="caret"></span></button> + <button data-toggle="dropdown" class="btn dropdown-toggle" type="button"><%= components[components[editingComponent].parent].name || "No Parent Selected" %><span class="caret"></span></button> <ul role="menu" class="dropdown-menu"> <% _.each(components, function(component){ %> <% if (component.id == editingComponent) return; %>