Browse Source

Fixed losing selection when changing configuration option `type` on the fly

flowchartTest
jos 9 years ago
parent
commit
bca61e3f07
1 changed files with 4 additions and 2 deletions
  1. +4
    -2
      lib/timeline/Timeline.js

+ 4
- 2
lib/timeline/Timeline.js View File

@ -168,8 +168,10 @@ Timeline.prototype.setOptions = function (options) {
// force recreation of all items // force recreation of all items
var itemsData = this.itemsData; var itemsData = this.itemsData;
if (itemsData) { if (itemsData) {
this.setItems(null); // remove all
this.setItems(itemsData); // add all
var selection = this.getSelection();
this.setItems(null); // remove all
this.setItems(itemsData); // add all
this.setSelection(selection); // restore selection
} }
} }
} }

Loading…
Cancel
Save