Skip to content

Commit

Permalink
Fix canva move failure if any extra class assigned to parent-drawflow…
Browse files Browse the repository at this point in the history
… div
  • Loading branch information
pavlyuts committed Mar 19, 2021
1 parent a6f4b21 commit fbe2125
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/drawflow.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ export default class Drawflow {
this.dispatch('click', e);
if(this.editor_mode === 'fixed') {
//return false;
if(e.target.classList[0] === 'parent-drawflow' || e.target.classList[0] === 'drawflow') {
if(e.target.matches('.parent-drawflow') || e.target.matches('.drawflow')) {
this.ele_selected = e.target.closest(".parent-drawflow");
} else {
return false;
Expand All @@ -198,7 +198,8 @@ export default class Drawflow {
this.ele_selected = e.target.closest(".drawflow_content_node").parentElement;
}
}
switch (this.ele_selected.classList[0]) {
for (let element of this.ele_selected.classList.values()) {
switch (element) {
case 'drawflow-node':
if(this.node_selected != null) {
this.node_selected.classList.remove("selected");
Expand Down Expand Up @@ -314,6 +315,7 @@ export default class Drawflow {
break;
default:
}
}
if (e.type === "touchstart") {
this.pos_x = e.touches[0].clientX;
this.pos_x_start = e.touches[0].clientX;
Expand Down

0 comments on commit fbe2125

Please sign in to comment.