diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-15 12:09:18 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-15 12:09:18 +0000 |
commit | b7c735c8ac11b8182807070fc6f84f2606e15427 (patch) | |
tree | e74b4d25abb8bbf23546f001dd94515e2840a3a3 /app/assets/javascripts/notes/components | |
parent | 221b529789f4090341a825695aeb49b8df6dd11d (diff) | |
download | gitlab-ce-b7c735c8ac11b8182807070fc6f84f2606e15427.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/note_header.vue | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/app/assets/javascripts/notes/components/note_header.vue b/app/assets/javascripts/notes/components/note_header.vue index 9cb592ceedb..f82b3554cac 100644 --- a/app/assets/javascripts/notes/components/note_header.vue +++ b/app/assets/javascripts/notes/components/note_header.vue @@ -39,13 +39,18 @@ export default { required: false, default: true, }, + showSpinner: { + type: Boolean, + required: false, + default: true, + }, }, computed: { toggleChevronClass() { return this.expanded ? 'fa-chevron-up' : 'fa-chevron-down'; }, noteTimestampLink() { - return `#note_${this.noteId}`; + return this.noteId ? `#note_${this.noteId}` : undefined; }, hasAuthor() { return this.author && Object.keys(this.author).length; @@ -60,7 +65,9 @@ export default { this.$emit('toggleHandler'); }, updateTargetNoteHash() { - this.setTargetNoteHash(this.noteTimestampLink); + if (this.$store) { + this.setTargetNoteHash(this.noteTimestampLink); + } }, }, }; @@ -101,16 +108,20 @@ export default { <template v-if="actionText">{{ actionText }}</template> </span> <a - ref="noteTimestamp" + v-if="noteTimestampLink" + ref="noteTimestampLink" :href="noteTimestampLink" class="note-timestamp system-note-separator" @click="updateTargetNoteHash" > <time-ago-tooltip :time="createdAt" tooltip-placement="bottom" /> </a> + <time-ago-tooltip v-else ref="noteTimestamp" :time="createdAt" tooltip-placement="bottom" /> </template> <slot name="extra-controls"></slot> <i + v-if="showSpinner" + ref="spinner" class="fa fa-spinner fa-spin editing-spinner" :aria-label="__('Comment is being updated')" aria-hidden="true" |