diff options
Diffstat (limited to 'app/assets/javascripts/diffs/components/diff_view.vue')
-rw-r--r-- | app/assets/javascripts/diffs/components/diff_view.vue | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/assets/javascripts/diffs/components/diff_view.vue b/app/assets/javascripts/diffs/components/diff_view.vue index 348d6d1d78d..7c87ea1cbf2 100644 --- a/app/assets/javascripts/diffs/components/diff_view.vue +++ b/app/assets/javascripts/diffs/components/diff_view.vue @@ -1,5 +1,6 @@ <script> import { mapGetters, mapState, mapActions } from 'vuex'; +import { throttle } from 'lodash'; import { IdState } from 'vendor/vue-virtual-scroller'; import DraftNote from '~/batch_comments/components/draft_note.vue'; import draftCommentsMixin from '~/diffs/mixins/draft_comments'; @@ -77,6 +78,9 @@ export default { return this.codequalityDiff?.files?.[this.diffFile.file_path]?.length > 0; }, }, + created() { + this.onDragOverThrottled = throttle((line) => this.onDragOver(line), 100, { leading: true }); + }, methods: { ...mapActions(['setSelectedCommentPosition']), ...mapActions('diffs', ['showCommentForm', 'setHighlightedRow', 'toggleLineDiscussions']), @@ -255,7 +259,7 @@ export default { ({ lineCode, expanded }) => toggleLineDiscussions({ lineCode, fileHash: diffFile.file_hash, expanded }) " - @enterdragging="onDragOver" + @enterdragging="onDragOverThrottled" @startdragging="onStartDragging" @stopdragging="onStopDragging" /> |