Skip to content

Commit

Permalink
Prevent slide from moving to a new index if the slidebox is not setup…
Browse files Browse the repository at this point in the history
… yet (fix #4378)
  • Loading branch information
Alexandre Laurent committed Nov 30, 2015
1 parent 3adb7fc commit 6061b0a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions js/views/sliderView.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6061b0a

Please sign in to comment.