File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -549,19 +549,24 @@ export default {
549
549
touchStart (touchEvent ) {
550
550
if (touchEvent .changedTouches .length === 1 ) {
551
551
const posXStart = touchEvent .changedTouches [0 ].clientX
552
+ const posYStart = touchEvent .changedTouches [0 ].clientY
552
553
553
554
addEventListener (
554
555
' touchend' ,
555
- touchEvent => this .touchEnd (touchEvent, posXStart),
556
+ touchEvent => this .touchEnd (touchEvent, posXStart, posYStart ),
556
557
{ once: true }
557
558
)
558
559
}
559
560
},
560
- touchEnd (touchEvent , posXStart ) {
561
+ touchEnd (touchEvent , posXStart , posYStart ) {
561
562
if (touchEvent .changedTouches .length === 1 ) {
562
563
const posXEnd = touchEvent .changedTouches [0 ].clientX
564
+ const posYEnd = touchEvent .changedTouches [0 ].clientY
563
565
564
- if (posXEnd - posXStart > 30 ) {
566
+ const swippedRight = posXEnd - posXStart > 30
567
+ const swippedVertically = Math .abs (posYEnd - posYStart) > 50
568
+
569
+ if (swippedRight && ! swippedVertically) {
565
570
this .$emit (' toggle-rooms-list' )
566
571
}
567
572
}
You can’t perform that action at this time.
0 commit comments