Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-11-15 15:09:24 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-11-15 15:09:24 +0300
commit7912017a137da35c48071a048c99d27737c29f0f (patch)
treed967751ff35db3fb9ca788a36982a3f1f25bed92 /app/assets/javascripts/merge_request_tabs.js
parent25fdad39f53eb46b346076fd07bc2db9bc1d8ccb (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.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/assets/javascripts/merge_request_tabs.js b/app/assets/javascripts/merge_request_tabs.js
index 96fc1649d49..0ddf5def8ee 100644
--- a/app/assets/javascripts/merge_request_tabs.js
+++ b/app/assets/javascripts/merge_request_tabs.js
@@ -260,7 +260,7 @@ export default class MergeRequestTabs {
}
}
- tabShown(action, href) {
+ tabShown(action, href, shouldScroll = true) {
if (action !== this.currentTab && this.mergeRequestTabs) {
this.currentTab = action;
@@ -336,7 +336,7 @@ export default class MergeRequestTabs {
$('.detail-page-description').renderGFM();
- this.recallScroll(action);
+ if (shouldScroll) this.recallScroll(action);
} else if (action === this.currentAction) {
// ContentTop is used to handle anything at the top of the page before the main content
const mainContentContainer = document.querySelector('.content-wrapper');
@@ -350,7 +350,7 @@ export default class MergeRequestTabs {
const scrollDestination = tabContentTop - mainContentTop - 51;
// scrollBehavior is only available in browsers that support scrollToOptions
- if ('scrollBehavior' in document.documentElement.style) {
+ if ('scrollBehavior' in document.documentElement.style && shouldScroll) {
window.scrollTo({
top: scrollDestination,
behavior: 'smooth',