Add swipe-click handler to media modal

Now swiping will correctly change the current media, and with a good
preview. Clicking without swiping closes the overlay.
This commit is contained in:
Tusooa Zhu 2021-08-02 19:11:59 -04:00
parent a36673a6a8
commit 29cd8fbd3b
No known key found for this signature in database
GPG key ID: 7B467EDE43A08224
5 changed files with 94 additions and 168 deletions
src/components/media_modal

View file

@ -4,9 +4,16 @@
class="media-modal-view"
@backdropClicked="hide"
>
<div class="modal-image-container">
<SwipeClick
class="modal-image-container"
:direction="swipeDirection"
:threshold="swipeThreshold"
@preview-requested="handleSwipePreview"
@swipe-finished="handleSwipeEnd"
@swipeless-clicked="hide"
>
<PinchZoom
options="pinchZoomOptions"
ref="pinchZoom"
class="modal-image-container-inner"
selector=".modal-image"
allow-pan-min-scale="1"
@ -26,7 +33,7 @@
@load="onImageLoaded"
>
</PinchZoom>
</div>
</SwipeClick>
<VideoAttachment
v-if="type === 'video'"
class="modal-image"