Node gets inserted after body tag.. Fix
AbdisamadMoh opened this issue · 1 comments
AbdisamadMoh commented
Node gets inserted after the body tag if you choose insert "AFTER"
function addSectionComponent(component, after = true) {
let node = generateElements(component.html)[0];
if (after) {
//start
if (addSectionElement.tagName == "BODY") {
addSectionElement.append(node);
} else {
addSectionElement.after(node);
}
//end
} else {
addSectionElement.append(node);
}
if (component.afterDrop) {
node = component.afterDrop(node);
}
node = node;
self.selectNode(node);
self.loadNodeComponent(node);
Vvveb.TreeList.loadComponents();
Vvveb.TreeList.selectComponent(node);
Vvveb.Undo.addMutation({
type: "childList",
target: node.parentNode,
addedNodes: [node],
nextSibling: node.nextSibling,
});
}
If the selected node is body insert within the body.