Changed deleted local ids to api ids
This commit is contained in:
@@ -225,7 +225,6 @@ export default {
|
||||
this.draggingLink = null;
|
||||
}
|
||||
if (typeof target.className === 'string' && target.className.indexOf('node-delete') > -1) {
|
||||
// console.log('delete2', this.action.dragging);
|
||||
this.nodeDelete(this.action.dragging);
|
||||
this.action.dragging = null;
|
||||
}
|
||||
@@ -261,13 +260,17 @@ export default {
|
||||
}));
|
||||
},
|
||||
nodeDelete(id) {
|
||||
const deleted_node = this.scene.nodes.find((node) => node.id === id);
|
||||
console.log(deleted_node);
|
||||
|
||||
this.scene.nodes = this.scene.nodes.filter((node) => {
|
||||
return node.id !== id;
|
||||
})
|
||||
|
||||
this.scene.links = this.scene.links.filter((link) => {
|
||||
return link.from !== id && link.to !== id
|
||||
})
|
||||
this.$emit('nodeDelete', id)
|
||||
});
|
||||
this.$emit('nodeDelete', deleted_node);
|
||||
},
|
||||
dataUpdated(id, newData) {
|
||||
this.$emit('nodeDataEdited', id, newData);
|
||||
|
||||
Reference in New Issue
Block a user