diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-14 15:09:31 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-14 15:09:31 +0300 |
commit | 9769ccf613ec45634ee32efaf1c39763a759a917 (patch) | |
tree | a48a3a73458978a2e9cfe0a0e1b4ace4c7c9da53 /app/assets/javascripts/diffs | |
parent | 66f492cea7772633bfb6e0cb1352d90d10a67008 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/diffs')
-rw-r--r-- | app/assets/javascripts/diffs/components/app.vue | 8 | ||||
-rw-r--r-- | app/assets/javascripts/diffs/components/virtual_scroller_scroll_sync.js | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/app/assets/javascripts/diffs/components/app.vue b/app/assets/javascripts/diffs/components/app.vue index 0a400fa95d2..c86f2c8451c 100644 --- a/app/assets/javascripts/diffs/components/app.vue +++ b/app/assets/javascripts/diffs/components/app.vue @@ -570,12 +570,8 @@ export default { this.scrollVirtualScrollerToIndex(index); } }, - async scrollVirtualScrollerToIndex(index) { + scrollVirtualScrollerToIndex(index) { this.virtualScrollCurrentIndex = index; - - await this.$nextTick(); - - this.virtualScrollCurrentIndex = -1; }, scrollVirtualScrollerToDiffNote() { const id = window?.location?.hash; @@ -701,7 +697,7 @@ export default { </dynamic-scroller-item> </template> </pre-renderer> - <virtual-scroller-scroll-sync :index="virtualScrollCurrentIndex" /> + <virtual-scroller-scroll-sync v-model="virtualScrollCurrentIndex" /> </template> </dynamic-scroller> <template v-else> diff --git a/app/assets/javascripts/diffs/components/virtual_scroller_scroll_sync.js b/app/assets/javascripts/diffs/components/virtual_scroller_scroll_sync.js index 984c6f8c0c9..d44dffecc38 100644 --- a/app/assets/javascripts/diffs/components/virtual_scroller_scroll_sync.js +++ b/app/assets/javascripts/diffs/components/virtual_scroller_scroll_sync.js @@ -2,6 +2,9 @@ import { handleLocationHash } from '~/lib/utils/common_utils'; export default { inject: ['vscrollParent'], + model: { + prop: 'index', + }, props: { index: { type: Number, @@ -39,6 +42,7 @@ export default { methods: { scrollToIndex(index) { this.vscrollParent.scrollToItem(index); + this.$emit('update', -1); setTimeout(() => { handleLocationHash(); |