From bca61e3f07561117863be304b3d6cf95df68806e Mon Sep 17 00:00:00 2001 From: jos Date: Wed, 20 May 2015 12:09:01 +0200 Subject: [PATCH] Fixed losing selection when changing configuration option `type` on the fly --- lib/timeline/Timeline.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/timeline/Timeline.js b/lib/timeline/Timeline.js index 6ddc1876..b59ff2da 100644 --- a/lib/timeline/Timeline.js +++ b/lib/timeline/Timeline.js @@ -168,8 +168,10 @@ Timeline.prototype.setOptions = function (options) { // force recreation of all items var itemsData = this.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 } } }