diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-18 06:09:24 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-18 06:09:24 +0300 |
commit | 95f5aad5aa99577555f01476f771e581957934f1 (patch) | |
tree | 3ce10768748ac63c5b42dfbfde989983afa54973 /app/assets/javascripts/batch_comments | |
parent | ccefff8087799bc076737ad080f18cf98e6fe114 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/batch_comments')
-rw-r--r-- | app/assets/javascripts/batch_comments/components/draft_note.vue | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/app/assets/javascripts/batch_comments/components/draft_note.vue b/app/assets/javascripts/batch_comments/components/draft_note.vue index 4c100ec7335..92203381154 100644 --- a/app/assets/javascripts/batch_comments/components/draft_note.vue +++ b/app/assets/javascripts/batch_comments/components/draft_note.vue @@ -3,6 +3,7 @@ import { mapActions, mapGetters, mapState } from 'vuex'; import NoteableNote from '~/notes/components/noteable_note.vue'; import LoadingButton from '~/vue_shared/components/loading_button.vue'; import PublishButton from './publish_button.vue'; +import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; export default { components: { @@ -10,6 +11,7 @@ export default { PublishButton, LoadingButton, }, + mixins: [glFeatureFlagsMixin()], props: { draft: { type: Object, @@ -64,14 +66,27 @@ export default { handleNotEditing() { this.isEditingDraft = false; }, + handleMouseEnter(draft) { + if (this.glFeatures.multilineComments && draft.position) { + this.setSelectedCommentPositionHover(draft.position.line_range); + } + }, + handleMouseLeave(draft) { + // Even though position isn't used here we still don't want to unecessarily call a mutation + // The lack of position tells us that highlighting is irrelevant in this context + if (this.glFeatures.multilineComments && draft.position) { + this.setSelectedCommentPositionHover(); + } + }, }, }; </script> <template> <article + role="article" class="draft-note-component note-wrapper" - @mouseenter="setSelectedCommentPositionHover(draft.position.line_range)" - @mouseleave="setSelectedCommentPositionHover()" + @mouseenter="handleMouseEnter(draft)" + @mouseleave="handleMouseLeave(draft)" > <ul class="notes draft-notes"> <noteable-note |