fixed add bug. added push test

This commit is contained in:
Rijn 2017-01-16 17:51:03 -06:00
parent 77d460e8c4
commit 5e8be9b390
2 changed files with 15 additions and 2 deletions

View file

@ -147,7 +147,8 @@
add (offset) {
let index = this.currentIndex;
index += offset;
if (index === this.slides.length) index = 0;
while (index < 0) index += this.slides.length;
index = index % this.slides.length;
this.currentIndex = index;
},
slide () {