diff options
author | Fatih Acet <acetfatih@gmail.com> | 2017-07-07 02:13:10 +0300 |
---|---|---|
committer | Fatih Acet <acetfatih@gmail.com> | 2017-07-21 22:35:25 +0300 |
commit | 993936fbd0ea62acb37da865767a1e67bea5cc1f (patch) | |
tree | 1d79cae9cbb873ecb0a0e5a4ee0147e7115ad805 /app/assets/javascripts/lib | |
parent | b72db79668ff5ede3124933a989a547cf17c4dee (diff) | |
download | gitlab-ce-993936fbd0ea62acb37da865767a1e67bea5cc1f.tar.gz |
IssueNotesRefactor: Implement jumping to target note.
Diffstat (limited to 'app/assets/javascripts/lib')
-rw-r--r-- | app/assets/javascripts/lib/utils/common_utils.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/app/assets/javascripts/lib/utils/common_utils.js b/app/assets/javascripts/lib/utils/common_utils.js index 122ec138c59..1580bb67d65 100644 --- a/app/assets/javascripts/lib/utils/common_utils.js +++ b/app/assets/javascripts/lib/utils/common_utils.js @@ -162,10 +162,11 @@ gl.utils.scrollToElement = function($el) { var top = $el.offset().top; - gl.mrTabsHeight = gl.mrTabsHeight || $('.merge-request-tabs').height(); + var mrTabsHeight = $('.merge-request-tabs').height() || 0; + var headerHeight = $('.navbar-gitlab').height() || 0; return $('body, html').animate({ - scrollTop: top - (gl.mrTabsHeight) + scrollTop: top - mrTabsHeight - headerHeight }, 200); }; |