Add closed-check for touchmove

This commit is contained in:
shpuld 2018-12-23 20:14:40 +02:00
parent e46b560ead
commit 4752081818
2 changed files with 6 additions and 2 deletions

View File

@ -33,7 +33,7 @@ const SideDrawer = {
},
touchMove (e) {
const delta = deltaX(this.touchX, touchEventX(e))
if (delta < -30) {
if (delta < -30 && !this.closed) {
this.toggleDrawer()
}
}

View File

@ -1,6 +1,10 @@
<template>
<div class="side-drawer-container" :class="{ 'side-drawer-container-closed': closed, 'side-drawer-container-open': !closed }">
<div class="panel panel-default side-drawer" :class="{'side-drawer-closed': closed}" @touchstart="touchStart" @touchmove.prevent="touchMove">
<div class="panel panel-default side-drawer"
:class="{'side-drawer-closed': closed}"
@touchstart="touchStart"
@touchmove.prevent="touchMove"
>
<div class="side-drawer-heading">
<user-card-content :activatePanel="activatePanel" :user="currentUser" :switcher="false" :hideBio="true">
</user-card-content>