Not unselecting when clicking copy, delete or startnode anymore
This commit is contained in:
@@ -1787,13 +1787,41 @@ const AngularWorkflow = (defaultprops) => {
|
||||
};
|
||||
|
||||
const onUnselect = (event) => {
|
||||
console.time("UNSELECT");
|
||||
|
||||
const nodedata = event.target.data();
|
||||
if (nodedata.app_name === undefined && nodedata.source === undefined) {
|
||||
return;
|
||||
console.log("UNSELECT: ", nodedata);
|
||||
//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.
|
||||
// Should probably be done in the onBlur for the textfield instead
|
||||
@@ -1861,8 +1889,9 @@ const AngularWorkflow = (defaultprops) => {
|
||||
left: 0,
|
||||
selected: "",
|
||||
});
|
||||
console.timeEnd("UNSELECT");
|
||||
//console.timeEnd("UNSELECT");
|
||||
})
|
||||
}, 150)
|
||||
};
|
||||
|
||||
const onEdgeSelect = (event) => {
|
||||
@@ -2282,6 +2311,7 @@ const AngularWorkflow = (defaultprops) => {
|
||||
return
|
||||
} else if (data.buttonType === "copy") {
|
||||
console.log("COPY!");
|
||||
|
||||
// 1. Find parent
|
||||
// 2. Find branches for parent
|
||||
// 3. Make a new node that's moved a little bit
|
||||
|
||||
Reference in New Issue
Block a user