src/lib/entity.js
function insertAfter(newNode, referenceNode) {
  if (!referenceNode.parentNode) {
    referenceNode = AFRAME.INSPECTOR.selectedEntity;
  }

  if (!referenceNode) {
    AFRAME.INSPECTOR.sceneEl.appendChild(newNode);
  } else {
    referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling);
  }
}
function insertAfter(newNode, referenceNode) {
  if (!referenceNode.parentNode) {
    referenceNode = AFRAME.INSPECTOR.selectedEntity;
  }

  if (!referenceNode) {
    AFRAME.INSPECTOR.sceneEl.appendChild(newNode);
  } else {
    referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling);
  }
}
function insertAfter ( newNode , referenceNode ) { if ( ! referenceNode . parentNode ) { referenceNode = AFRAME . INSPECTOR . selectedEntity ; } if ( ! referenceNode ) { AFRAME . INSPECTOR . sceneEl . appendChild ( newNode ) ; } else { referenceNode . parentNode . insertBefore ( newNode , referenceNode . nextSibling ) ; } }
Insert an node after a referenced node.
@param  {Element} newNode       Node to insert.
@param  {Element} referenceNode Node used as reference to insert after it.
Insert an node after a referenced node .