MediaModal: Close on browser navigation events.
This commit is contained in:
parent
5ac2c365a7
commit
cb99dc2b27
|
@ -84,10 +84,12 @@ const MediaModal = {
|
|||
}
|
||||
},
|
||||
mounted () {
|
||||
window.addEventListener('popstate', this.hide)
|
||||
document.addEventListener('keyup', this.handleKeyupEvent)
|
||||
document.addEventListener('keydown', this.handleKeydownEvent)
|
||||
},
|
||||
destroyed () {
|
||||
window.removeEventListener('popstate', this.hide)
|
||||
document.removeEventListener('keyup', this.handleKeyupEvent)
|
||||
document.removeEventListener('keydown', this.handleKeydownEvent)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue