From 6061b0a4f1da39356fac0b860838b360a44de5f0 Mon Sep 17 00:00:00 2001 From: Alexandre Laurent Date: Mon, 30 Nov 2015 20:22:28 +0100 Subject: [PATCH] Prevent slide from moving to a new index if the slidebox is not setup yet (fix #4378) --- js/views/sliderView.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/js/views/sliderView.js b/js/views/sliderView.js index 2c57c8291a6..c968ec49d9a 100644 --- a/js/views/sliderView.js +++ b/js/views/sliderView.js @@ -124,6 +124,11 @@ ionic.views.Slider = ionic.views.View.inherit({ // do nothing if already on requested slide if (index == to) return; + if (!slides) { + index = to; + return; + } + if (browser.transitions) { var direction = Math.abs(index - to) / (index - to); // 1: backward, -1: forward