diff options
| author | lain <lain@soykaf.club> | 2020-06-04 16:30:28 +0200 |
|---|---|---|
| committer | lain <lain@soykaf.club> | 2020-06-04 16:30:28 +0200 |
| commit | cb99dc2b270d2554f7e2fc85707786a74563e0ca (patch) | |
| tree | 4994753f620ccf4ccf44350f915be7d477c182b7 /src | |
| parent | 5ac2c365a72bad6dba74cbecef1b40af3f594ff6 (diff) | |
MediaModal: Close on browser navigation events.
Diffstat (limited to 'src')
| -rw-r--r-- | src/components/media_modal/media_modal.js | 2 |
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) } |
