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
1 changed files with 25 additions and 16 deletions

View File

@ -11,20 +11,26 @@
<div class="media-scroll-item">
<div class="media-scroll-item-inner">
<div class="media-scroll-item-inner-inner">
<PinchZoomable className='media-pinch-zoom' disabled={!pinchZoomMode} >
{#if canPinchZoom}
<PinchZoomable className='media-pinch-zoom' disabled={!pinchZoomMode} >
<MediaInDialog {media} />
</PinchZoomable>
{:else}
<MediaInDialog {media} />
</PinchZoomable>
{/if}
</div>
</div>
</div>
{/each}
</div>
<div class="media-controls-outside">
<IconButton
className="media-control-button media-control-button-dummy-spacer"
href="#fa-search"
label=""
/>
{#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,14 +60,16 @@
/>
</div>
{/if}
<IconButton
className="media-control-button"
pressable={true}
pressed={pinchZoomMode}
label={pinchZoomMode ? 'Disable pinch-zoom mode' : 'Enable pinch-zoom mode'}
href="#fa-search"
on:click="togglePinchZoomMode()"
/>
{#if canPinchZoom}
<IconButton
className="media-control-button"
pressable={true}
pressed={pinchZoomMode}
label={pinchZoomMode ? 'Disable pinch-zoom mode' : 'Enable pinch-zoom mode'}
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,