Skip to content

Commit

Permalink
Merge pull request #13 from asadarafat/dev-frontend
Browse files Browse the repository at this point in the history
fix the dummy node not deleted when the group id edited before adding…
  • Loading branch information
asadarafat authored Feb 23, 2025
2 parents 3b353fd + 865fd8c commit 4ee605a
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion html-static/js/dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,9 @@ document.addEventListener("DOMContentLoaded", async function () {
}
});

// console.log(`assignedParent id: ${assignedParent.id()}, assignedParentChildren: ${assignedParent.children()}` )


if (assignedParent) {
// If dragged inside a parent, reassign the node to that parent
draggedNode.move({
Expand All @@ -374,7 +377,12 @@ document.addEventListener("DOMContentLoaded", async function () {
console.info(`${draggedNode.id()} became a child of ${assignedParent.id()}`);

// Get the dummy child node using your naming convention
const dummyChild = cy.getElementById(`${assignedParent.id()}:dummyChild`);
// const dummyChild = cy.getElementById(`${assignedParent.id()}:dummyChild`);

// Get the dummy child node using topoViewerRole
const dummyChild = assignedParent.children('[topoViewerRole = "dummyChild"]');

console.log(`assignedParent id: ${assignedParent.id()}, assignedParentChildren: ${assignedParent.children()}, assignedParentDoummyChild: ${dummyChild.id()}` )

// Only proceed if the dummy child exists
if (dummyChild.length > 0) {
Expand Down Expand Up @@ -405,6 +413,9 @@ document.addEventListener("DOMContentLoaded", async function () {

// To release the node from the parent, alt + shift + click on the node.
}

// console.log(`AFTER assignedParent id: ${assignedParent.id()}, assignedParentChildren: ${assignedParent.children()}` )

});


Expand Down

0 comments on commit 4ee605a

Please sign in to comment.