Destilled node operations to an operation queue
This commit is contained in:
@@ -152,7 +152,11 @@ export default {
|
||||
const existed = this.scene.links.find((link) => {
|
||||
return link.from === this.draggingLink.from && link.to === index;
|
||||
})
|
||||
if (!existed) {
|
||||
// check for conflicting
|
||||
const conflicting = this.scene.links.find((link) => { // This makes sure that only one link can go towards a node
|
||||
return link.to === index;
|
||||
})
|
||||
if (!existed && !conflicting) {
|
||||
let maxID = Math.max(0, ...this.scene.links.map((link) => {
|
||||
return link.id
|
||||
}))
|
||||
@@ -223,10 +227,16 @@ export default {
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.action.dragging) {
|
||||
this.$emit("nodeMoved", this.action.dragging);
|
||||
this.action.dragging = null;
|
||||
}
|
||||
|
||||
this.action.linking = false;
|
||||
this.action.dragging = null;
|
||||
this.action.scrolling = false;
|
||||
},
|
||||
handleDown(e) {
|
||||
|
||||
Reference in New Issue
Block a user