From 2ffa4ef324562d0bd61e2f7b62dfcff45d8baf33 Mon Sep 17 00:00:00 2001 From: Joe Motacek Date: Wed, 10 Dec 2014 12:06:01 -0600 Subject: [PATCH] Prevents crashes... I'm owrking on creating simple data filters for my timeline JS implementation. so far it's been pretty easy I'm just filtering the data on my page and calling the reload method. However, if you use the reload function and are on a slide the current slide will get jacked up and cause a crash. This prevents the crash. --- build/js/timeline.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/build/js/timeline.js b/build/js/timeline.js index 7a81874..9dc87cc 100644 --- a/build/js/timeline.js +++ b/build/js/timeline.js @@ -5265,6 +5265,10 @@ if(typeof VMM != 'undefined' && typeof VMM.Slider == 'undefined') { VMM.Lib.width($slides_items, (slides.length * config.slider.content.width)); + if(typeof current_slide == "undefined"){ + current_slide = 0; + } + if (_from_start) { VMM.Lib.css($slider_container, "left", slides[current_slide].leftpos()); }