NUKnightLab / TimelineJS3

TimelineJS v3: A Storytelling Timeline built in JavaScript. http://timeline.knightlab.com
Mozilla Public License 2.0
2.97k stars 620 forks source link

initial_zoom: 0 is ignored #848

Open dshapiro-whitecap opened 7 months ago

dshapiro-whitecap commented 7 months ago

This issue is caused by this line: https://github.com/NUKnightLab/TimelineJS3/blob/6a78272866d86e10baf6c025941347e7bc946011/src/js/timeline/Timeline.js#L437

The if condition inappropriately bypasses setting the initial zoom to index 0 due to the falsy nature of JavaScript and should, instead, be something like:

if (this.options.initial_zoom !== undefined && this.options.initial_zoom !== null)

vivienzhou2014 commented 6 months ago

I am working on this.