Skip to content
This repository was archived by the owner on Jul 29, 2019. It is now read-only.

Conversation

@eymiha
Copy link
Contributor

@eymiha eymiha commented Nov 17, 2016

fixes #2233
fixes #2068
fixes #1756

This adjusts the docs to the actual old mechanism and adds new code to skip the endpoint dragging and go straight to a user-defined edge editor if given.

Adding

{ manipulation: { editEdge: { editWithoutDrag: function } } }

calls the function directly, before any endpoint dragging takes place. If the old mechanism that activates endpoint dragging before the function call is desired, just supply the function directly as the value for edgeEdit.

In addition, the selected edge's label is added to the data passed to the edit function.

Also, when the user edit is cancelled, the edit bar was not being redisplayed. This is also fixed.

@mojoaxel
Copy link
Member

@eymiha Could you please add (or improve an existing) example to show this new feature. That way it would be much easier to test.

@eymiha
Copy link
Contributor Author

eymiha commented Nov 20, 2016

I added a quick and dirty example manipulation that edits edge labels via a popup, without dragging first. Edge creation still allows a drag, but the label assignment is included as well.

Copy link
Member

@mojoaxel mojoaxel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Now I understand! Maybe in the future we can merge the two examples manipulationEditEdgeNoDrag.html and manipulation.html. I think one would be enough.

@mojoaxel mojoaxel merged commit 17ce133 into visjs:develop Nov 21, 2016
@mojoaxel
Copy link
Member

@eymiha Thanks very much for this nice improvement!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants