diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-02 21:18:39 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-02 21:18:39 +0300 |
commit | b9ce0fe1e6311105b7a748126621f9bfbe37fb2e (patch) | |
tree | c73b711a72de036cf3f48be9365038fea171c8c6 /app/assets/javascripts/merge_request_tabs.js | |
parent | 6f991190fe4dbb93070b090a9a31d71b25e8101d (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/merge_request_tabs.js')
-rw-r--r-- | app/assets/javascripts/merge_request_tabs.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/app/assets/javascripts/merge_request_tabs.js b/app/assets/javascripts/merge_request_tabs.js index 8fc341c4ca8..237e8c68be4 100644 --- a/app/assets/javascripts/merge_request_tabs.js +++ b/app/assets/javascripts/merge_request_tabs.js @@ -252,10 +252,11 @@ export default class MergeRequestTabs { } recallScroll(action) { const storedPosition = this.scrollPositions[action]; + if (storedPosition == null) return; setTimeout(() => { window.scrollTo({ - top: storedPosition && storedPosition > 0 ? storedPosition : 0, + top: storedPosition > 0 ? storedPosition : 0, left: 0, behavior: 'auto', }); @@ -308,7 +309,7 @@ export default class MergeRequestTabs { const tab = this.mergeRequestTabs.querySelector(`.${action}-tab`); if (tab) tab.classList.add('active'); - if (!this.loadedPages[action] && action in pageBundles) { + if (isInVueNoteablePage() && !this.loadedPages[action] && action in pageBundles) { toggleLoader(true); pageBundles[action]() .then(({ default: init }) => { |