From 81a5c7384751c999188e1a983e5108db6ca67130 Mon Sep 17 00:00:00 2001 From: Wayne Ellis Date: Sun, 23 Apr 2023 20:39:24 +0100 Subject: [PATCH] fixed moduleChanged notification issue the moduleChanged notification was firing before the module had been updated on screen, which for me was causing issues about html elements not being available. If people need to know the module is changing, I have also added a moduleChanging event. --- src/drawflow.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/drawflow.js b/src/drawflow.js index 9442379..7b69769 100644 --- a/src/drawflow.js +++ b/src/drawflow.js @@ -1846,7 +1846,7 @@ export default class Drawflow { this.dispatch('moduleCreated', name); } changeModule(name) { - this.dispatch('moduleChanged', name); + this.dispatch('moduleChanging', name) this.module = name; this.precanvas.innerHTML = ""; this.canvas_x = 0; @@ -1859,6 +1859,7 @@ export default class Drawflow { this.zoom_last_value = 1; this.precanvas.style.transform = ''; this.import(this.drawflow, false); + this.dispatch('moduleChanged', name); } removeModule(name) {