Skip to content

Commit

Permalink
#update update on event callbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
Wlada committed May 30, 2017
1 parent bfe9e10 commit b49c4f8
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 29 deletions.
4 changes: 2 additions & 2 deletions dist/vue-carousel-3d.min.js

Large diffs are not rendered by default.

15 changes: 0 additions & 15 deletions docs/source/api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,18 +122,3 @@ Slide inverse scaling

* **Type**: `Number`
* **Default**: `300`

### onLastSlide

Callback triggered on last slide

* **Type**: `Function`
* **param**: `index`

### onSlideChange

Callback triggered on slide changed

* **Type**: `Function`
* **param**: `index`

5 changes: 5 additions & 0 deletions docs/source/examples/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ Without any options configured and seven slides added to 3D Carousel

<script async src="//jsfiddle.net/Wlada/kqen0yba/embed/result,js,html,css/?accentColor=405671"></script>

## Callbacks

Callbacks added, seven slides added to 3D Carousel

<script async src="//jsfiddle.net/Wlada/dtwg9kr9/embed/result,js,html,css/?accentColor=405671"></script>

## Controls

Expand Down
4 changes: 2 additions & 2 deletions docs/themes/vue/source/js/vue-carousel-3d.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue-carousel-3d",
"version": "0.1.9",
"version": "0.1.10",
"description": "Beautiful, flexible and touch supported 3D Carousel for Vue.js",
"main": "dist/vue-carousel-3d.min.js",
"scripts": {
Expand Down
12 changes: 6 additions & 6 deletions play/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,9 @@ play('Carousel3d', module)

.add("callbacks through emit", {
template: `<carousel-3d
@afterSlideChanged="onAfterSlideChanged"
@lastSlide="onLastSlide"
@slideChange="onSlideChange">
@before-slide-change="onSlideChange"
@after-slide-change="onAfterSlideChanged"
@last-slide="onLastSlide">
<slide v-for="(slide, i) in slides" :index="i">
<img :src="slide.src">
</slide>
Expand All @@ -273,13 +273,13 @@ play('Carousel3d', module)
},
methods: {
onAfterSlideChanged(index){
console.log('@afterSlideChanged Callback Triggered', 'Slide Index ' + index)
console.log('@after-slide-changed Callback Triggered', 'Slide Index ' + index)
},
onSlideChange(index){
console.log('@slideChange Callback Triggered', 'Slide Index ' + index)
console.log('@before-slide-change Callback Triggered', 'Slide Index ' + index)
},
onLastSlide(index){
console.log('@lastSlide Callback Triggered', 'Slide Index ' + index)
console.log('@last-slide Callback Triggered', 'Slide Index ' + index)
}
}
})
6 changes: 3 additions & 3 deletions src/Carousel3d.vue
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,10 @@
}
this.onLastSlide(this.currentIndex)
this.$emit('lastSlide', this.currentIndex)
this.$emit('last-slide', this.currentIndex)
}
this.$emit('slideChange', this.currentIndex)
this.$emit('before-slide-change', this.currentIndex)
setTimeout(() => this.animationEnd(), this.animationSpeed)
},
Expand Down Expand Up @@ -253,7 +253,7 @@
}
this.onSlideChange(this.currentIndex)
this.$emit('afterSlideChanged', this.currentIndex)
this.$emit('after-slide-change', this.currentIndex)
},
/**
* Trigger actions when mouse is released
Expand Down

0 comments on commit b49c4f8

Please sign in to comment.