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

feat(dia.ToolView): add visibility option callback #2745

Merged
merged 4 commits into from
Aug 27, 2024

Conversation

kumilingus
Copy link
Contributor

Description

Add a callback visibility option to toggle the tools' visibility based on the current state of the cell view.

With this option and the change introduced in #2743, the double link tool can be easily implemented as follows:

new dia.ToolsView({
    new linkTools.Remove({
       distance: (linkView) => linkView.getConnectionLength() > 100 ? 20 : '50%'   
    }),
    new linkTools.Remove({
       distance: -20,
       visibility: (linkView) => linkView.getConnectionLength() > 100
    })
})

@kumilingus kumilingus marked this pull request as ready for review August 23, 2024 14:23
@Geliogabalus Geliogabalus merged commit 3706574 into clientIO:master Aug 27, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants