diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-18 09:06:43 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-18 09:06:43 +0000 |
commit | 5333cb6c7c960aac58af40c898c87d050d829383 (patch) | |
tree | 79cac8f3f0cf63340b3c0c305d2d1e9780f43ea6 /app/assets/javascripts/notes/components | |
parent | 44baf08d4ff4b0d32fecfded843257e2fc49a63c (diff) | |
download | gitlab-ce-5333cb6c7c960aac58af40c898c87d050d829383.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/notes/components')
-rw-r--r-- | app/assets/javascripts/notes/components/notes_app.vue | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/app/assets/javascripts/notes/components/notes_app.vue b/app/assets/javascripts/notes/components/notes_app.vue index c6c97489e5e..9d1de4ef8a0 100644 --- a/app/assets/javascripts/notes/components/notes_app.vue +++ b/app/assets/javascripts/notes/components/notes_app.vue @@ -122,6 +122,8 @@ export default { this.toggleAward({ awardName, noteId }); }); } + + window.addEventListener('hashchange', this.handleHashChanged); }, updated() { this.$nextTick(() => { @@ -131,6 +133,7 @@ export default { }, beforeDestroy() { this.stopPolling(); + window.removeEventListener('hashchange', this.handleHashChanged); }, methods: { ...mapActions([ @@ -138,7 +141,6 @@ export default { 'fetchDiscussions', 'poll', 'toggleAward', - 'scrollToNoteIfNeeded', 'setNotesData', 'setNoteableData', 'setUserData', @@ -151,6 +153,13 @@ export default { 'convertToDiscussion', 'stopPolling', ]), + handleHashChanged() { + const noteId = this.checkLocationHash(); + + if (noteId) { + this.setTargetNoteHash(getLocationHash()); + } + }, fetchNotes() { if (this.isFetching) return null; @@ -194,6 +203,8 @@ export default { this.expandDiscussion({ discussionId: discussion.id }); } } + + return noteId; }, startReplying(discussionId) { return this.convertToDiscussion(discussionId) |