Skip to content

Commit

Permalink
refactor: Small enhancements for Slider
Browse files Browse the repository at this point in the history
  • Loading branch information
rstoenescu committed Mar 12, 2017
1 parent 65a6a8b commit 3d6165e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
17 changes: 16 additions & 1 deletion dev/components/components/slider.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
</q-slider>

<p class="caption">
Slider with Centered Content and Infinite Scrolling
Slider with Centered Content and Infinite Scroll
</p>
<q-slider infinite arrows dots class="text-white">
<div slot="slide" class="bg-primary centered">
Expand All @@ -48,6 +48,21 @@
</div>
</q-slider>

<p class="caption">
Slider with Infinite Scroll and Autoplay
</p>
<q-slider infinite autoplay arrows dots class="text-white">
<div slot="slide" class="bg-primary centered">
Slide 1
</div>
<div slot="slide" class="bg-secondary centered">
Slide 2
</div>
<div slot="slide" class="bg-tertiary centered">
Slide 3
</div>
</q-slider>

<p class="caption">
Slider with Custom Actions as Controls
</p>
Expand Down
4 changes: 0 additions & 4 deletions src/vue-components/slider/Slider.vue
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,7 @@ export default {
},
methods: {
__pan (event) {
console.log('__pan')
if (this.infinite && this.animationInProgress) {
console.log('return', this.infinite, this.animationInProgress)
return
}
if (!this.hasOwnProperty('initialPosition')) {
Expand All @@ -135,13 +133,11 @@ export default {
this.positionSlide = (event.direction === 'left' ? this.slide + 1 : this.slide - 1)
if (event.isFinal) {
console.log('final')
this.goToSlide(
event.distance.x < 100
? this.slide
: this.positionSlide,
() => {
console.log('deleting initialPosition')
delete this.initialPosition
}
)
Expand Down

0 comments on commit 3d6165e

Please sign in to comment.