Add hooks to Node Lifecycle (#1882)

*  add hook when closing node editing view

*  add hook for node deletion

*  add hook call to escape key
This commit is contained in:
Ben Hesseldieck
2021-06-18 22:47:03 +02:00
committed by GitHub
parent 0470740737
commit c0c994d245
3 changed files with 5 additions and 3 deletions

View File

@@ -86,11 +86,9 @@ export default mixins(externalHooks, nodeHelpers, workflowHelpers).extend({
return this.$store.getters.activeNode;
},
nodeType (): INodeTypeDescription | null {
const activeNode = this.node;
if (this.node) {
return this.$store.getters.nodeType(this.node.type);
}
return null;
},
},
@@ -111,6 +109,7 @@ export default mixins(externalHooks, nodeHelpers, workflowHelpers).extend({
close (e: MouseEvent) {
// @ts-ignore
if (e.target.className && e.target.className.includes && e.target.className.includes('close-on-click')) {
this.$externalHooks().run('dataDisplay.nodeEditingFinished');
this.showDocumentHelp = false;
this.$store.commit('setActiveNode', null);
}