forked from cybrespace/pinafore
parent
94baf9e396
commit
c54aaf2fa4
|
@ -131,8 +131,9 @@
|
||||||
let dialogElement = this.refs.node.parentElement
|
let dialogElement = this.refs.node.parentElement
|
||||||
this._a11yDialog = new A11yDialog(dialogElement)
|
this._a11yDialog = new A11yDialog(dialogElement)
|
||||||
this._a11yDialog.on('hide', () => {
|
this._a11yDialog.on('hide', () => {
|
||||||
this._a11yDialog.destroy()
|
|
||||||
let { id } = this.get()
|
let { id } = this.get()
|
||||||
|
this.fire('close')
|
||||||
|
this._a11yDialog.destroy()
|
||||||
emit('destroyDialog', id)
|
emit('destroyDialog', id)
|
||||||
requestAnimationFrame(() => document.body.removeChild(dialogElement))
|
requestAnimationFrame(() => document.body.removeChild(dialogElement))
|
||||||
})
|
})
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
background="var(--muted-modal-bg)"
|
background="var(--muted-modal-bg)"
|
||||||
muted="true"
|
muted="true"
|
||||||
className="video-modal-dialog"
|
className="video-modal-dialog"
|
||||||
|
on:close="onClose()"
|
||||||
>
|
>
|
||||||
<video {poster}
|
<video {poster}
|
||||||
{src}
|
{src}
|
||||||
|
@ -11,6 +12,7 @@
|
||||||
{height}
|
{height}
|
||||||
aria-label="Video: {description || ''}"
|
aria-label="Video: {description || ''}"
|
||||||
controls
|
controls
|
||||||
|
ref:video
|
||||||
/>
|
/>
|
||||||
</ModalDialog>
|
</ModalDialog>
|
||||||
<style>
|
<style>
|
||||||
|
@ -32,7 +34,12 @@
|
||||||
ModalDialog
|
ModalDialog
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
show
|
show,
|
||||||
|
onClose () {
|
||||||
|
if (this.refs.video && !this.refs.video.paused) {
|
||||||
|
this.refs.video.pause()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
Loading…
Reference in New Issue