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