Skip to content

Commit

Permalink
0.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
weotch committed Feb 1, 2022
1 parent 6562280 commit 99b0ed4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
17 changes: 16 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -731,16 +731,31 @@ Code related to auotplay features of the carousel
},
methods: {
autoplayStart: function () {
// Don't loop if we only have one page
if (this.pages <= 0) {
return;
}

if (this.autoplayDelay) {
return this.autoPlayInterval = setInterval(() => {
if (!this.autoplayPaused) {
return this.next();
return this.autoplayNext();
}
}, this.autoplayDelay * 1000);
}
},
autoplayStop: function () {
return clearInterval(this.autoPlayInterval);
},
autoplayNext: function () {
var nextIndex;
nextIndex = this.index + 1;

if (nextIndex < this.pages) {
return this.next();
} else {
return this.goto(0);
}
}
}
});
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue-ssr-carousel",
"version": "0.3.0",
"version": "0.3.1",
"description": "A performance focused Vue carousel designed for SSR/SSG environments.",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 99b0ed4

Please sign in to comment.