Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions src/Carousel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,16 @@ export default {
type: Boolean,
default: false
},

endOfCarouselLink: {
type: String,
default: null
},

beginningOfCarouselLink: {
type: String,
defualt: null
},
/**
* Slide transition easing
* Any valid CSS transition easing accepted
Expand Down Expand Up @@ -540,12 +550,23 @@ export default {
advancePage(direction) {
if (direction && direction === "backward" && this.canAdvanceBackward) {
this.goToPage(this.getPreviousPage(), "navigation");
this.$log("1");
} else if (
(!direction || (direction && direction !== "backward")) &&
this.canAdvanceForward
) {
this.goToPage(this.getNextPage(), "navigation");
this.$log("2");
}
else if (direction && direction === "backward" && !this.canAdvanceBackward && this.beginningOfCarouselLink) {
this.$log("beginnning");
this.route(this.beginningOfCarouselLink);
}
else if (direction && direction === "forward" && !this.canAdvanceForward && this.endOfCarouselLink !== null) {
this.$log("end");
this.route(this.endOfCarouselLink);
}

},
goToLastSlide() {
// following code is to disable animation
Expand Down Expand Up @@ -914,6 +935,9 @@ export default {
handleTransitionEnd() {
this.$emit("transitionEnd");
this.$emit("transition-end");
},
route(link) {
window.location.href = link
}
},
mounted() {
Expand Down