aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHJ <30-hj@users.noreply.git.pleroma.social>2020-06-04 16:00:53 +0000
committerHJ <30-hj@users.noreply.git.pleroma.social>2020-06-04 16:00:53 +0000
commita6f73d7da52177b66ea6ca7128baa64bd13e3dfd (patch)
tree40608d5dee7ce0a7909a42f30a9fb1baa837a69b
parent7f755878d583a4de2cb211da692c546474eeeb27 (diff)
parentcb99dc2b270d2554f7e2fc85707786a74563e0ca (diff)
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
-rw-r--r--src/components/media_modal/media_modal.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/components/media_modal/media_modal.js b/src/components/media_modal/media_modal.js
index abb18c7d..24764e80 100644
--- a/src/components/media_modal/media_modal.js
+++ b/src/components/media_modal/media_modal.js
@@ -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)
}