Thanks to visit codestin.com
Credit goes to github.com

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

Conversation

@yotamberk
Copy link
Member

checkout #2805.
I've realized that @henev is right and there should be callback functions for timeline methods using animations. So I added this PR to have the ability to call a callback function right after the setRange finishes (after the animation is done). This is in addition to rangechange event that gets called after these methods.

else {
animation = (options && options.animation !== undefined) ? options.animation : true;
this.range.setRange(start, end, animation);
this.range.setRange(start, end, { animation: animation }, callback);
Copy link
Contributor

Choose a reason for hiding this comment

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

This optional arguments / callback handling is starting to get pretty messy. Not sure of a better way - perhaps treating the callback as a option?

Copy link
Member Author

Choose a reason for hiding this comment

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

Short answer: No.
I really think the callback function should be separated from the options.
It's not exactly an option and should be passed through in an object.

@bradh bradh merged commit 3d1e8a3 into visjs:develop Apr 1, 2017
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.

4 participants