Skip to content
This repository was archived by the owner on Feb 24, 2023. It is now read-only.

Commit 8ca90a7

Browse files
Better fix for #129
1 parent e34f5ed commit 8ca90a7

File tree

2 files changed

+13
-24
lines changed

2 files changed

+13
-24
lines changed

demo/examples/Example1.vue

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,9 @@
99

1010
div.row
1111
div.col-xs-12
12-
agile
12+
agile(:slides-to-show="5", :infinite="false")
1313
div.slide(v-for="n in 6", :key="n", :class="`slide--${n}`")
14-
p {{ text[n - 1] }}
15-
14+
h3 {{ n }}
1615

1716
template(#prevButton)
1817
i.fas.fa-chevron-left
@@ -24,20 +23,7 @@
2423

2524
<script>
2625
export default {
27-
name: 'Example1',
28-
29-
data () {
30-
return {
31-
text: [
32-
'I\'m using the carousel to display text only testimonials and although it\'s working fine on Chrome, Firefox and Safari (mobiles are good too) it\'s not rendering correctly in Edge.It\'s currently live so that you can see the issue here, about halfway down: https://www.vibecast.comI\'ve tried forcing height and also height 100%, but I can\'t get it to play nicely in Edge.\n',
33-
'I\'m using the carousel to display text only testimonials and although it\'s working fine on Chrome, Firefox and Safari (mobiles are good too) it\'s not rendering correctly in Edge.It\'s currently live so that you can see the issue here, about halfway down: https://www.vibecast.comI\'ve tried forcing height and also height 100%, but I can\'t get it to play nicely in Edge.\nI\'m using the carousel to display text only testimonials and although it\'s working fine on Chrome, Firefox and Safari (mobiles are good too) it\'s not rendering correctly in Edge.It\'s currently live so that you can see the issue here, about halfway down: https://www.vibecast.comI\'ve tried forcing height and also height 100%, but I can\'t get it to play nicely in Edge.\n',
34-
'I\'m using the carousel to display text only testimonials and although it\'s working fine on Chrome, Firefox and Safari (mobiles are good too) it\'s not rendering correctly in Edge.It\'s currently live so that you can see the issue here, about halfway down: https://www.vibecast.comI\'ve tried forcing height and also height 100%, but I can\'t get it to play nicely in Edge.\n',
35-
'I\'m using the carousel to display text only testimonials and although it\'s working fine on Chrome, Firefox and Safari (mobiles are good too) it\'s not rendering correctly in Edge.It\'s currently live so that you can see the issue here, about halfway down: https://www.vibecast.comI\'ve tried forcing height and also height 100%, but I can\'t get it to play nicely in Edge.\nI\'m using the carousel to display text only testimonials and although it\'s working fine on Chrome, Firefox and Safari (mobiles are good too) it\'s not rendering correctly in Edge.It\'s currently live so that you can see the issue here, about halfway down: https://www.vibecast.comI\'ve tried forcing height and also height 100%, but I can\'t get it to play nicely in Edge.\nI\'m using the carousel to display text only testimonials and although it\'s working fine on Chrome, Firefox and Safari (mobiles are good too) it\'s not rendering correctly in Edge.It\'s currently live so that you can see the issue here, about halfway down: https://www.vibecast.comI\'ve tried forcing height and also height 100%, but I can\'t get it to play nicely in Edge.\nI\'m using the carousel to display text only testimonials and although it\'s working fine on Chrome, Firefox and Safari (mobiles are good too) it\'s not rendering correctly in Edge.It\'s currently live so that you can see the issue here, about halfway down: https://www.vibecast.comI\'ve tried forcing height and also height 100%, but I can\'t get it to play nicely in Edge.\n',
36-
'I\'m using the carousel to display text only testimonials and although it\'s working fine on Chrome, Firefox and Safari (mobiles are good too) it\'s not rendering correctly in Edge.It\'s currently live so that you can see the issue here, about halfway down: https://www.vibecast.comI\'ve tried forcing height and also height 100%, but I can\'t get it to play nicely in Edge.\n',
37-
'I\'m using the carousel to display text only testimonials and although it\'s working fine on Chrome, Firefox and Safari (mobiles are good too) it\'s not rendering correctly in Edge.It\'s currently live so that you can see the issue here, about halfway down: https://www.vibecast.comI\'ve tried forcing height and also height 100%, but I can\'t get it to play nicely in Edge.\n'
38-
]
39-
}
40-
}
26+
name: 'Example1'
4127
}
4228
</script>
4329

@@ -82,11 +68,11 @@
8268
8369
// Slides styles
8470
.slide
85-
height: 100%
86-
/*align-items: center*/
87-
/*color: #fff*/
88-
/*display: flex*/
89-
/*justify-content: center*/
71+
height: 400px
72+
align-items: center
73+
color: #fff
74+
display: flex
75+
justify-content: center
9076
padding: 40px
9177
9278
h3

src/Agile.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@
150150
},
151151
152152
canGoToNext: function () {
153-
return (this.settings.infinite || (this.currentSlide < this.countSlides - 1 && this.currentSlide + this.slidesToShow < this.countSlides))
153+
return (this.settings.infinite || this.currentSlide < this.countSlides - 1)
154154
},
155155
156156
countSlides: function () {
@@ -282,7 +282,10 @@
282282
283283
let translateX = (!this.settings.fade) ? n * this.widthSlide * this.settings.slidesToScroll : 0
284284
this.transitionDelay = (transition) ? this.speed : 0
285-
this.translateX = (this.settings.rtl) ? translateX : -1 * translateX
285+
286+
if (this.infinite || (this.currentSlide + this.slidesToShow <= this.countSlides)) {
287+
this.translateX = (this.settings.rtl) ? translateX : -1 * translateX
288+
}
286289
},
287290
288291
// Go to next slide

0 commit comments

Comments
 (0)