summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2016-10-19 17:24:24 +0100
committerPhil Hughes <me@iamphill.com>2016-10-20 19:34:35 +0100
commita28371dbe33c568c970c704b90760d2b540256af (patch)
tree0a77d3704a93ee69ae28e7b1884ebd9baa2993c7
parent4e03f4c40602b568cffd591dcd5af6bd4b9a281e (diff)
downloadgitlab-ce-a28371dbe33c568c970c704b90760d2b540256af.tar.gz
Fixed issue when images are loading it would push off the tabsfixed-mr-tabs-fixes
-rw-r--r--app/assets/javascripts/merge_request_tabs.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/app/assets/javascripts/merge_request_tabs.js b/app/assets/javascripts/merge_request_tabs.js
index 1a04a037210..9f28738e06b 100644
--- a/app/assets/javascripts/merge_request_tabs.js
+++ b/app/assets/javascripts/merge_request_tabs.js
@@ -389,12 +389,18 @@
if (Breakpoints.get().getBreakpointSize() === 'xs' || !$tabs.length) return;
var $diffTabs = $('#diff-notes-app'),
- offsetTop = $tabs.offset().top - ($('.navbar-fixed-top').height() + $('.layout-nav').height());
+ $fixedNav = $('.navbar-fixed-top'),
+ $layoutNav = $('.layout-nav');
$tabs.off('affix.bs.affix affix-top.bs.affix')
.affix({
offset: {
- top: offsetTop
+ top: function () {
+ var tabsTop = $diffTabs.offset().top - $tabs.height();
+ tabsTop = tabsTop - ($fixedNav.height() + $layoutNav.height());
+
+ return tabsTop;
+ }
}
}).on('affix.bs.affix', function () {
$diffTabs.css({