From 9491fe4c2ae67efa3c829d341b8a42e40bf716c1 Mon Sep 17 00:00:00 2001 From: Daniel Date: Thu, 9 May 2013 09:39:25 +0300 Subject: [PATCH 1/2] added reset function call reset function before populating timeline with new data (before calling my_timeline_obj.init(my_timeline_config);) example make global: var timeline_config, storyjs_embedjs; //in your init function : if (storyjs_embedjs === undefined) { storyjs_embedjs = new VMM.Timeline('my-timeline', '100%', '100%'); storyjs_embedjs.init(timeline_config); } else { storyjs_embedjs.reset(); storyjs_embedjs.init(timeline_config); } --- source/js/VMM.Timeline.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/source/js/VMM.Timeline.js b/source/js/VMM.Timeline.js index 7d2fb8c39..656632300 100755 --- a/source/js/VMM.Timeline.js +++ b/source/js/VMM.Timeline.js @@ -449,7 +449,12 @@ if(typeof VMM != 'undefined' && typeof VMM.Timeline == 'undefined') { slider.setSlide(0); timenav.setMarker(0, config.ease,config.duration); }; - + //call this function before + this.reset = function() { + config.current_slide = 0; + slider.setSlide(0); + timenav.setMarker(0, config.ease,config.duration); + } /* DATA ================================================== */ function getData(url) { @@ -719,4 +724,4 @@ if(typeof VMM != 'undefined' && typeof VMM.Timeline == 'undefined') { VMM.Timeline.Config = {}; -}; \ No newline at end of file +}; From d91e813b513838b0d5c53c2aeaade353d58a9e49 Mon Sep 17 00:00:00 2001 From: Daniel Date: Thu, 9 May 2013 09:41:48 +0300 Subject: [PATCH 2/2] better comment better comment --- source/js/VMM.Timeline.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/js/VMM.Timeline.js b/source/js/VMM.Timeline.js index 656632300..c075ccb59 100755 --- a/source/js/VMM.Timeline.js +++ b/source/js/VMM.Timeline.js @@ -449,7 +449,7 @@ if(typeof VMM != 'undefined' && typeof VMM.Timeline == 'undefined') { slider.setSlide(0); timenav.setMarker(0, config.ease,config.duration); }; - //call this function before + //call this function before loading timeline with new data this.reset = function() { config.current_slide = 0; slider.setSlide(0);