NUKnightLab / NUKnightLab/TimelineJS3

"loaded" and "dataloaded" events don't seem to fire

Open
#285 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug
Dominant language
JavaScript
Stars
3.2k
Forks
645
PR merge metrics
No merged PRs in 30d

Description

Unless I have misunderstood the API, the "loaded" and "dataloaded" events seem to fire before we have a chance to register an event handler.

function alerter(s) {
  return function() { alert(s); };
}

// https://github.com/NUKnightLab/TimelineJS3/blob/3.3.7/API.md#events
// events that don't fire as expected:
//   loaded, dataloaded
var events = [
  "back_to_start",
  "change",
  "dataloaded",
  "loaded",
  "zoom_in",
  "zoom_out",
  "nav_next",
  "nav_previous"
];

timeline = new TL.Timeline(
  'timeline-embed',
  'https://docs.google.com/spreadsheets/d/1cWqQBZCkX9GpzFtxCWHoqFXCHg-ylTVUWlnrdYMzKUI/pubhtml'
);

events.forEach(function(evt) {
  timeline.on(evt, alerter(evt));
});
Test Case

http://jsfiddle.net/fiddlegrimbo/mpdfa9s5/

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the behavior using the linked JSFiddle and compare it with the loaded and dataloaded entries in API.md. Trace when those events are emitted relative to the TL.Timeline construction and handler registration; done means the handlers in the example receive both events as documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.