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:
HJ 2020-06-04 16:00:53 +00:00
commit a6f73d7da5

View file

@ -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)
}