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(linkTools.Button): allow distance to be defined via callback #2743

Merged
merged 1 commit into from
Aug 26, 2024

Conversation

kumilingus
Copy link
Contributor

Description

Allow the position of the link tool buttons to be dynamic.

For instance, based on the connection length:

new linkTools.Button({
    // show button 20px from the target for short links
    // and in the middle of the link for longer links
    distance: (view) => view.getConnectionLength() < 100 ? -20 : '50%'
});

@Geliogabalus Geliogabalus merged commit 5168a3a into clientIO:master Aug 26, 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