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

Commit b65e5ec

Browse files
author
Łukasz Florczak
committed
Merge branch 'master' into develop
* master: 0.3.5 MouseOver event fix # Conflicts: # src/Agile.vue
2 parents 489a03c + cb24124 commit b65e5ec

File tree

2 files changed

+20
-18
lines changed

2 files changed

+20
-18
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-agile",
3-
"version": "0.3.4",
3+
"version": "0.3.5",
44
"description": "Carousel component for Vue.js",
55
"author": "Łukasz Florczak <[email protected]>",
66
"license": "MIT",

src/Agile.vue

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -287,14 +287,18 @@
287287
},
288288
289289
handleMouseOver (element) {
290-
if ((element === 'dot' && this.settings.pauseOnDotsHover) || (element === 'track' && this.settings.pauseOnHover)) {
291-
this.disableAutoplayMode()
290+
if (this.settings.autoplay) {
291+
if ((element === 'dot' && this.settings.pauseOnDotsHover) || (element === 'track' && this.settings.pauseOnHover)) {
292+
this.disableAutoplayMode()
293+
}
292294
}
293295
},
294296
295297
handleMouseOut (element) {
296-
if ((element === 'dot' && this.settings.pauseOnDotsHover) || (element === 'track' && this.settings.pauseOnHover)) {
297-
this.enableAutoplayMode()
298+
if (this.settings.autoplay) {
299+
if ((element === 'dot' && this.settings.pauseOnDotsHover) || (element === 'track' && this.settings.pauseOnHover)) {
300+
this.enableAutoplayMode()
301+
}
298302
}
299303
},
300304
@@ -574,25 +578,23 @@
574578
},
575579
576580
dragDistance () {
577-
if (!this.mouseDown) {
578-
return false
579-
}
581+
if (this.mouseDown) {
582+
if (this.dragDistance > this.swipeDistance) {
583+
if (!this.settings.infinite && this.currentSlide === 0) {
584+
return
585+
}
580586
581-
if (this.dragDistance > this.swipeDistance) {
582-
if (!this.settings.infinite && this.currentSlide === 0) {
583-
return
587+
this.prevSlide()
584588
}
585589
586-
this.goToPrev()
587-
this.handleMouseUp()
588-
}
590+
if (this.dragDistance < -1 * this.swipeDistance) {
591+
if (!this.settings.infinite && this.currentSlide === this.slidesCount - 1) {
592+
return
593+
}
589594
590-
if (this.dragDistance < -1 * this.swipeDistance) {
591-
if (!this.settings.infinite && this.currentSlide === this.slidesCount - 1) {
592-
return
595+
this.nextSlide()
593596
}
594597
595-
this.goToNext()
596598
this.handleMouseUp()
597599
}
598600
}

0 commit comments

Comments
 (0)