Closed shailesh345 closed 3 years ago
Hello I just tested and it works. Complete html example.
Are you listening to the event before deleting the module?
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Drawflow</title>
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/gh/jerosoler/Drawflow/dist/drawflow.min.css"
/>
<script src="https://unpkg.com/drawflow@0.0.45/dist/drawflow.min.js"></script>
<script src="minimap-drawflow.js"></script>
<style>
#drawflow {
position: relative;
width: 800px;
height: 800px;
border: 1px solid red;
}
</style>
</head>
<body>
<div id="drawflow"></div>
<div><div id="minimap"></div></div>
<script>
var id = document.getElementById("drawflow");
const editor = new Drawflow(id);
editor.start();
editor.on('moduleRemoved', function(name) {
alert(name);
})
editor.addModule('Other');
editor.removeModule('Other');
</script>
</body>
</html>
List of available events: