Merge branch '788-hide-media-viewer-on-navigation' into 'develop'
MediaModal: Close on browser navigation events. Closes #788 See merge request pleroma/pleroma-fe!1129
This commit is contained in:
commit
a6f73d7da5
1 changed files with 2 additions and 0 deletions
|
@ -84,10 +84,12 @@ const MediaModal = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
|
window.addEventListener('popstate', this.hide)
|
||||||
document.addEventListener('keyup', this.handleKeyupEvent)
|
document.addEventListener('keyup', this.handleKeyupEvent)
|
||||||
document.addEventListener('keydown', this.handleKeydownEvent)
|
document.addEventListener('keydown', this.handleKeydownEvent)
|
||||||
},
|
},
|
||||||
destroyed () {
|
destroyed () {
|
||||||
|
window.removeEventListener('popstate', this.hide)
|
||||||
document.removeEventListener('keyup', this.handleKeyupEvent)
|
document.removeEventListener('keyup', this.handleKeyupEvent)
|
||||||
document.removeEventListener('keydown', this.handleKeydownEvent)
|
document.removeEventListener('keydown', this.handleKeydownEvent)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue