Skip to content

Commit

Permalink
Fix: ページ移動してもメディアビューワーが残ってしまう
Browse files Browse the repository at this point in the history
  • Loading branch information
mei23 committed Oct 6, 2019
1 parent 7671373 commit 1bb5a09
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/client/app/common/views/components/media-image.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,12 @@ export default Vue.extend({
},
methods: {
onClick() {
this.$root.new(ImageViewer, {
const viewer = this.$root.new(ImageViewer, {
image: this.image
});
this.$once('hook:beforeDestroy', () => {
viewer.close();
});
}
}
});
Expand Down
7 changes: 5 additions & 2 deletions src/client/app/desktop/views/components/media-video.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,13 @@ export default Vue.extend({
start = videoTag.currentTime
videoTag.pause()
}
this.$root.new(MkMediaVideoDialog, {
const viewer = this.$root.new(MkMediaVideoDialog, {
video: this.video,
start,
})
});
this.$once('hook:beforeDestroy', () => {
viewer.close();
});
}
}
})
Expand Down

0 comments on commit 1bb5a09

Please sign in to comment.