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

Bug: When setting "editable:true" after initialization, items that were added previously are not editable #99

Open
daattali opened this issue Jan 17, 2019 · 0 comments
Labels
bug Something isn't working

Comments

@daattali
Copy link

If you initialize a timeline with no options, and then use setOptions({editable:true}), any items that were created on initialization are not editable (cannot be moved or deleted). If the timeline is initialized with editable:true then all items are editable.

Minimal reproducible code:

<!DOCTYPE HTML>
<html>
<head>
  <title>Timeline basic demo</title>
  <script src="https://unpkg.com/timeline-plus/dist/timeline.js"></script>
  <link href="https://unpkg.com/timeline-plus/dist/timeline.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="visualization"></div>

<script type="text/javascript">
  var container = document.getElementById('visualization');
  var items = [
    {id: 1, content: 'item 1', start: '2013-04-19'},
    {id: 2, content: 'item 2', start: '2013-04-20'}
  ]
  var timeline = new timeline.Timeline(container, items, {});
  timeline.setOptions({editable:true})
</script>
</body>
</html>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants