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