Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#2279 Have a property not to display the context toolbar when the use… #2280

Merged
merged 2 commits into from
Dec 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading