File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 2
2
<div
3
3
v-show =" (isMobile && !showRoomsList) || !isMobile || singleRoom"
4
4
class =" vac-col-messages"
5
+ @touchstart =" touchStart"
5
6
>
6
7
<slot v-if =" showNoRoom" name =" no-room-selected" >
7
8
<div class =" vac-container-center vac-room-empty" >
@@ -562,6 +563,26 @@ export default {
562
563
},
563
564
564
565
methods: {
566
+ touchStart (touchEvent ) {
567
+ if (touchEvent .changedTouches .length === 1 ) {
568
+ const posXStart = touchEvent .changedTouches [0 ].clientX
569
+
570
+ addEventListener (
571
+ ' touchend' ,
572
+ touchEvent => this .touchEnd (touchEvent, posXStart),
573
+ { once: true }
574
+ )
575
+ }
576
+ },
577
+ touchEnd (touchEvent , posXStart ) {
578
+ if (touchEvent .changedTouches .length === 1 ) {
579
+ const posXEnd = touchEvent .changedTouches [0 ].clientX
580
+
581
+ if (posXEnd - posXStart > 30 ) {
582
+ this .$emit (' toggle-rooms-list' )
583
+ }
584
+ }
585
+ },
565
586
onRoomChanged () {
566
587
this .loadingMessages = true
567
588
this .scrollIcon = false
You can’t perform that action at this time.
0 commit comments