Not unselecting when clicking copy, delete or startnode anymore

This commit is contained in:
frikky
2022-03-18 23:21:01 +01:00
parent 24555f104a
commit 9628b1c533
+36 -6
View File
@@ -1787,13 +1787,41 @@ const AngularWorkflow = (defaultprops) => {
}; };
const onUnselect = (event) => { const onUnselect = (event) => {
console.time("UNSELECT");
const nodedata = event.target.data(); const nodedata = event.target.data();
if (nodedata.app_name === undefined && nodedata.source === undefined) { console.log("UNSELECT: ", nodedata);
return; //if (nodedata.type === "ACTION") {
// setLastSelected(nodedata)
//}
//
// Wait for new node to possibly be selected
setTimeout(() => {
const typeIds = cy.elements('node:selected').jsons();
console.log("Found: ", typeIds)
for (var idkey in typeIds) {
const item = typeIds[idkey]
console.log("items: ", item)
if (item.data.isButton === true) {
console.log("Reselect old node & return - or just return?")
if (item.data.buttonType === "delete" && item.data.attachedTo === nodedata.id) {
console.log("delete of same node!")
} }
event.target.removeClass("selected"); return
}
}
//if (nodedata.app_name === undefined && nodedata.source === undefined) {
// return;
//}
//event.target.removeClass("selected");
//
//// If button is clicked, select current node
// Attempt at rewrite of name in other actions in following nodes. // Attempt at rewrite of name in other actions in following nodes.
// Should probably be done in the onBlur for the textfield instead // Should probably be done in the onBlur for the textfield instead
@@ -1861,8 +1889,9 @@ const AngularWorkflow = (defaultprops) => {
left: 0, left: 0,
selected: "", selected: "",
}); });
console.timeEnd("UNSELECT"); //console.timeEnd("UNSELECT");
}) })
}, 150)
}; };
const onEdgeSelect = (event) => { const onEdgeSelect = (event) => {
@@ -2282,6 +2311,7 @@ const AngularWorkflow = (defaultprops) => {
return return
} else if (data.buttonType === "copy") { } else if (data.buttonType === "copy") {
console.log("COPY!"); console.log("COPY!");
// 1. Find parent // 1. Find parent
// 2. Find branches for parent // 2. Find branches for parent
// 3. Make a new node that's moved a little bit // 3. Make a new node that's moved a little bit