summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Greiling <mike@pixelcog.com>2018-06-29 20:22:00 +0000
committerFilipa Lacerda <filipa@gitlab.com>2018-07-04 11:27:37 +0100
commit07eb706f1ae7bdbd1b9fce7f90817e7ef8ce418b (patch)
treef6a9fbe8c314afafb162530424de8fa28b9ea295
parenta8a85e60aa5133730448f79f8ca83dd57c68fb25 (diff)
downloadgitlab-ce-07eb706f1ae7bdbd1b9fce7f90817e7ef8ce418b.tar.gz
Merge branch '47661-merge-request-box-disappearing-on-chrome' into 'master'
Replace deprecated bs.affix in merge request tabs with sticky polyfill Closes #47661 See merge request gitlab-org/gitlab-ce!20269
-rw-r--r--app/assets/javascripts/merge_request_tabs.js19
-rw-r--r--changelogs/unreleased/47661-merge-request-box-disappearing-on-chrome.yml5
2 files changed, 7 insertions, 17 deletions
diff --git a/app/assets/javascripts/merge_request_tabs.js b/app/assets/javascripts/merge_request_tabs.js
index 65ab41559be..23c66d10e43 100644
--- a/app/assets/javascripts/merge_request_tabs.js
+++ b/app/assets/javascripts/merge_request_tabs.js
@@ -14,6 +14,7 @@ import Diff from './diff';
import { localTimeAgo } from './lib/utils/datetime_utility';
import syntaxHighlight from './syntax_highlight';
import Notes from './notes';
+import { polyfillSticky } from './lib/utils/sticky';
/* eslint-disable max-len */
// MergeRequestTabs
@@ -417,7 +418,6 @@ export default class MergeRequestTabs {
initAffix() {
const $tabs = $('.js-tabs-affix');
- const $fixedNav = $('.navbar-gitlab');
// Screen space on small screens is usually very sparse
// So we dont affix the tabs on these
@@ -430,21 +430,6 @@ export default class MergeRequestTabs {
*/
if ($tabs.css('position') !== 'static') return;
- const $diffTabs = $('#diff-notes-app');
-
- $tabs
- .off('affix.bs.affix affix-top.bs.affix')
- .affix({
- offset: {
- top: () => $diffTabs.offset().top - $tabs.height() - $fixedNav.height(),
- },
- })
- .on('affix.bs.affix', () => $diffTabs.css({ marginTop: $tabs.height() }))
- .on('affix-top.bs.affix', () => $diffTabs.css({ marginTop: '' }));
-
- // Fix bug when reloading the page already scrolling
- if ($tabs.hasClass('affix')) {
- $tabs.trigger('affix.bs.affix');
- }
+ polyfillSticky($tabs);
}
}
diff --git a/changelogs/unreleased/47661-merge-request-box-disappearing-on-chrome.yml b/changelogs/unreleased/47661-merge-request-box-disappearing-on-chrome.yml
new file mode 100644
index 00000000000..7e6ab8d448b
--- /dev/null
+++ b/changelogs/unreleased/47661-merge-request-box-disappearing-on-chrome.yml
@@ -0,0 +1,5 @@
+---
+title: Replace deprecated bs.affix in merge request tabs with sticky polyfill
+merge_request:
+author:
+type: fixed