NUKnightLab / NUKnightLab/TimelineJS3

Empty style element on new Timeline

Open
#620 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

What went wrong

When calling the timeline constructor a new empty style tag is added to the head

What was expected

No addition of empty tags

Minimal working example

<!DOCTYPE html>
<html>
  <head>
    <link
      rel="stylesheet"
      href="https://cdn.knightlab.com/libs/timeline3/latest/css/timeline.css"
    />
    <script src="https://cdn.knightlab.com/libs/timeline3/latest/js/timeline.js"></script>
  </head>

  <body>
    <button onclick="loadTimeline()">Click me!</button>
    <div id="tl1" style="width: 100%; height: 600px"></div>
    <script type=text/javascript> function loadTimeline() { new
    TL.Timeline('tl1','https://docs.google.com/spreadsheets/d/1cWqQBZCkX9GpzFtxCWHoqFXCHg-ylTVUWlnrdYMzKUI/pubhtml');
    } 
    </script>
  </body>
</html>

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

Start with the TL.Timeline constructor shown in the minimal working example and reproduce the issue in a page using the provided CDN assets. Trace the constructor's DOM and style setup, then verify that creating a timeline no longer adds an empty style element to the document head.

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
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.