diff options
author | Jacob Schatz <jschatz@gitlab.com> | 2017-09-02 14:55:18 +0300 |
---|---|---|
committer | Jacob Schatz <jschatz@gitlab.com> | 2017-09-02 14:55:18 +0300 |
commit | 81002745184df28fc9d969afc524986279c653bb (patch) | |
tree | 386724b936531148dfe98110aa214b6deb0aa84a /app/assets/javascripts/lib | |
parent | 1e60725174cf8cfac1b54bbcdb1453d74bfdd37e (diff) | |
parent | 92edb3edab89dcb7b87bad3ac0fe7fed404fea85 (diff) |
Merge branch 'issue-discussions-refactor' into 'master'
Issue discussions Vue refactor
See merge request !12069
Diffstat (limited to 'app/assets/javascripts/lib')
-rw-r--r-- | app/assets/javascripts/lib/utils/common_utils.js | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/app/assets/javascripts/lib/utils/common_utils.js b/app/assets/javascripts/lib/utils/common_utils.js index b8f4f4eaba3..b8bebe1894f 100644 --- a/app/assets/javascripts/lib/utils/common_utils.js +++ b/app/assets/javascripts/lib/utils/common_utils.js @@ -27,6 +27,13 @@ } }; + w.gl.utils.isInIssuePage = () => { + const page = gl.utils.getPagePath(1); + const action = gl.utils.getPagePath(2); + + return page === 'issues' && action === 'show'; + }; + w.gl.utils.ajaxGet = function(url) { return $.ajax({ type: "GET", @@ -167,11 +174,12 @@ }; gl.utils.scrollToElement = function($el) { - var top = $el.offset().top; - gl.mrTabsHeight = gl.mrTabsHeight || $('.merge-request-tabs').height(); + const top = $el.offset().top; + const mrTabsHeight = $('.merge-request-tabs').height() || 0; + const headerHeight = $('.navbar-gitlab').height() || 0; return $('body, html').animate({ - scrollTop: top - (gl.mrTabsHeight) + scrollTop: top - mrTabsHeight - headerHeight, }, 200); }; |