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:
parent
a36673a6a8
commit
29cd8fbd3b
5 changed files with 94 additions and 168 deletions
src/components/media_modal
|
@ -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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue