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

Timeline .focus() should also zoom in as well as zoom out. Fix vertical scroll when not using groups or rtl = true #4038

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

nathanboktae
Copy link

Fixes #3389, #2475

setTimeout(setFinalVerticalPosition, 100);
};

// calculate the new middle and interval for the window
var middle = (start + end) / 2;
var interval = Math.max(this.range.end - this.range.start, (end - start) * 1.1);
var interval = (end - start) * 1.1;
Copy link
Author

Choose a reason for hiding this comment

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

Math.max ensured a zoom out, but never a zoom in, which is odd. make the behavior more consistent by just snapping to the item with 5% buffer on each side.

@yotamberk
Copy link
Contributor

Can you resubmit this PR implemented in the new fork I've moved to here:
https://github.com/yotamberk/timeline-plus
this fork is more updated and gets released with weekly updates

@yotamberk
Copy link
Contributor

I've now branched out to a new fork of my own including only Timeline.
I've applied your change here: https://github.com/yotamberk/timeline-plus
and can be used via npm here: https://www.npmjs.com/package/timeline-plus
Awesome fix! Thanks for your contribution! Future PRs will be reviewed and added in the new fork

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

Successfully merging this pull request may close these issues.

3 participants