fix: fix zoomable videos (#947)

fixes #946
This commit is contained in:
Nolan Lawson 2019-02-06 21:00:30 -08:00 committed by GitHub
parent 503378a400
commit 157f5db690
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -11,20 +11,26 @@
<div class="media-scroll-item">
<div class="media-scroll-item-inner">
<div class="media-scroll-item-inner-inner">
{#if canPinchZoom}
<PinchZoomable className='media-pinch-zoom' disabled={!pinchZoomMode} >
<MediaInDialog {media} />
</PinchZoomable>
{:else}
<MediaInDialog {media} />
{/if}
</div>
</div>
</div>
{/each}
</div>
<div class="media-controls-outside">
{#if canPinchZoom}
<IconButton
className="media-control-button media-control-button-dummy-spacer"
href="#fa-search"
label=""
/>
{/if}
{#if dots.length > 1}
<div class="media-controls">
<IconButton
@ -54,6 +60,7 @@
/>
</div>
{/if}
{#if canPinchZoom}
<IconButton
className="media-control-button"
pressable={true}
@ -62,6 +69,7 @@
href="#fa-search"
on:click="togglePinchZoomMode()"
/>
{/if}
</div>
</div>
</ModalDialog>
@ -206,7 +214,8 @@
}),
computed: {
length: ({ mediaItems }) => mediaItems.length,
dots: ({ length }) => times(length, i => ({ i }))
dots: ({ length }) => times(length, i => ({ i })),
canPinchZoom: ({ mediaItems }) => !mediaItems.some(media => media.type === 'video')
},
components: {
ModalDialog,