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

Commit 6d5b7a8

Browse files
author
Łukasz Florczak
committed
Fix RTL swiping & actions styles
1 parent b8e2dcf commit 6d5b7a8

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/Agile.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,7 @@
309309
310310
.agile--rtl .agile__track,
311311
.agile--rtl .agile__slides,
312+
.agile--rtl .agile__actions,
312313
.agile--rtl .agile__dots {
313314
flex-direction: row-reverse;
314315
}

src/mixins/watchers.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,15 @@ const mixin = {
3030
// Watch drag distance change
3131
dragDistance () {
3232
if (this.mouseDown) {
33-
if (this.dragDistance > this.swipeDistance && this.canGoToPrev) {
33+
const { rtl } = this.settings
34+
const dragDistance = this.dragDistance * (rtl ? -1 : 1)
35+
36+
if (dragDistance > this.swipeDistance && this.canGoToPrev) {
3437
this.goToPrev()
3538
this.handleMouseUp()
3639
}
3740

38-
if (this.dragDistance < -1 * this.swipeDistance && this.canGoToNext) {
41+
if (dragDistance < -1 * this.swipeDistance && this.canGoToNext) {
3942
this.goToNext()
4043
this.handleMouseUp()
4144
}

0 commit comments

Comments
 (0)