diff options
author | Annabel Dunstone Gray <annabel.dunstone@gmail.com> | 2017-06-23 11:24:15 +0300 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-06-23 11:24:15 +0300 |
commit | 588d55646d21dbd47e439f9cb1f2b0743e88a257 (patch) | |
tree | 5ee116032ab98cc2660ac6b4a3ca41c3f16ca0c4 /app/assets/javascripts/merge_request_tabs.js | |
parent | 6106400662c2af2ecba905221b00b712411f24ae (diff) |
Fix offset for fixed nav
Diffstat (limited to 'app/assets/javascripts/merge_request_tabs.js')
-rw-r--r-- | app/assets/javascripts/merge_request_tabs.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/assets/javascripts/merge_request_tabs.js b/app/assets/javascripts/merge_request_tabs.js index d2c64182248..786b6014dc6 100644 --- a/app/assets/javascripts/merge_request_tabs.js +++ b/app/assets/javascripts/merge_request_tabs.js @@ -155,7 +155,10 @@ import BlobForkSuggestion from './blob/blob_fork_suggestion'; scrollToElement(container) { if (location.hash) { - const offset = -$('.js-tabs-affix').outerHeight(); + const offset = 0 - ( + $('.navbar-gitlab').outerHeight() + + $('.js-tabs-affix').outerHeight() + ); const $el = $(`${container} ${location.hash}:not(.match)`); if ($el.length) { $.scrollTo($el[0], { offset }); @@ -301,6 +304,7 @@ import BlobForkSuggestion from './blob/blob_fork_suggestion'; forceShow: true, }); anchor[0].scrollIntoView(); + window.gl.utils.handleLocationHash(); // We have multiple elements on the page with `#note_xxx` // (discussion and diff tabs) and `:target` only applies to the first anchor.addClass('target'); |