Closed cer718 closed 2 years ago
Try reset all parameters.
De default constructor is:
constructor(container, render = null, parent = null) {
this.events = {};
this.container = container;
this.precanvas = null;
this.nodeId = 1;
this.ele_selected = null;
this.node_selected = null;
this.drag = false;
this.reroute = false;
this.reroute_fix_curvature = false;
this.curvature = 0.5;
this.reroute_curvature_start_end = 0.5;
this.reroute_curvature = 0.5;
this.reroute_width = 6;
this.drag_point = false;
this.editor_selected = false;
this.connection = false;
this.connection_ele = null;
this.connection_selected = null;
this.canvas_x = 0;
this.canvas_y = 0;
this.pos_x = 0;
this.pos_x_start = 0;
this.pos_y = 0;
this.pos_y_start = 0;
this.mouse_x = 0;
this.mouse_y = 0;
this.line_path = 5;
this.first_click = null;
this.force_first_input = false;
this.draggable_inputs = true;
this.useuuid = false;
this.parent = parent;
this.noderegister = {};
this.render = render;
this.drawflow = { "drawflow": { "Home": { "data": {} }}};
// Configurable options
this.module = 'Home';
this.editor_mode = 'edit';
this.zoom = 1;
this.zoom_max = 1.6;
this.zoom_min = 0.5;
this.zoom_value = 0.1;
this.zoom_last_value = 1;
// Mobile
this.evCache = new Array();
this.prevDiff = -1;
}
I checked that the problem was caused by not unregistering the event listener when changing the Drawflow object to null and clear. So I modified my project to use one HTML Element for one drawflow. My project no longer nulls/clears objects.
Thank you for supporting
Hi,
I faced a new problem. After clearing the editor as in the code below, I created the editor again.
And I registered connectionRemoved event listener, but error occur like below. I think the problem was caused by using the same node id as the previously created editor.
Please advise. Thank you for your help as always.