Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node gets inserted after body tag.. Fix #350

Open
AbdisamadMoh opened this issue May 4, 2024 · 0 comments
Open

Node gets inserted after body tag.. Fix #350

AbdisamadMoh opened this issue May 4, 2024 · 0 comments

Comments

@AbdisamadMoh
Copy link

Node gets inserted after the body tag if you choose insert "AFTER"

image
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant