Skip to content

Commit

Permalink
Merge pull request #928 from 3DStreet/remove-element-tag-and-class
Browse files Browse the repository at this point in the history
Remove element tag and class
  • Loading branch information
kfarr authored Nov 19, 2024
2 parents 8252e25 + 732df0f commit c5a0446
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/json-utils_1.1.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ function getElementData(entity) {
function getAttributes(entity) {
const elemObj = {};

elemObj['element'] = entity.tagName.toLowerCase();
const tagName = entity.tagName.toLowerCase();
if (tagName !== 'a-entity') {
elemObj['element'] = tagName;
}

if (entity.id) {
elemObj['id'] = entity.id;
Expand Down Expand Up @@ -406,8 +409,8 @@ Add a new entity with a list of components and children (if exists)
* @return {Element} Entity created
*/
function createEntityFromObj(entityData, parentEl) {
const entity =
entityData.entityElement || document.createElement(entityData.element);
const tagName = entityData.element || 'a-entity';
const entity = entityData.entityElement || document.createElement(tagName);

if (!entity.parentEl && parentEl) {
parentEl.appendChild(entity);
Expand Down

0 comments on commit c5a0446

Please sign in to comment.