Skip to content

Commit

Permalink
#2279 Have a property not to display the context toolbar when the use… (
Browse files Browse the repository at this point in the history
#2280)

Signed-off-by: CTomlyn <[email protected]>
  • Loading branch information
tomlyn authored Dec 17, 2024
1 parent cac0859 commit 497aa4b
Showing 1 changed file with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2294,7 +2294,9 @@ export default class SVGCanvasRenderer {
this.selectObjectD3Event(d3Event, d, "node");
}
this.setFocusObject(d, d3Event);
this.openContextMenu(d3Event, "node", d);
if (!this.config.enableContextToolbar) {
this.openContextMenu(d3Event, "node", d);
}
}
});
}
Expand Down Expand Up @@ -4199,13 +4201,16 @@ export default class SVGCanvasRenderer {
})
.on("contextmenu", (d3Event, d) => {
this.logger.log("Comment Group - context menu");
CanvasUtils.stopPropagationAndPreventDefault(d3Event);
// With enableDragWithoutSelect set to true, the object for which the
// context menu is being requested needs to be implicitely selected.
if (this.config.enableDragWithoutSelect) {
this.selectObjectD3Event(d3Event, d, "comment");
}
this.setFocusObject(d, d3Event);
this.openContextMenu(d3Event, "comment", d);
if (!this.config.enableContextToolbar) {
this.openContextMenu(d3Event, "comment", d);
}
});
}

Expand Down Expand Up @@ -4697,11 +4702,14 @@ export default class SVGCanvasRenderer {
})
.on("contextmenu", (d3Event, d) => {
this.logger.log("Link Group - context menu");
CanvasUtils.stopPropagationAndPreventDefault(d3Event);
if (this.config.enableLinkSelection !== LINK_SELECTION_NONE) {
this.selectObjectD3Event(d3Event, d, "link");
}
this.setFocusObject(d, d3Event);
this.openContextMenu(d3Event, "link", d);
if (!this.config.enableContextToolbar) {
this.openContextMenu(d3Event, "link", d);
}
});
}

Expand Down

0 comments on commit 497aa4b

Please sign in to comment.