BigW Consortium Gitlab

fixed alignment in button

correctly scroll to element with sticky height offset
parent 30777178
...@@ -86,8 +86,9 @@ ...@@ -86,8 +86,9 @@
// This is required to handle non-unicode characters in hash // This is required to handle non-unicode characters in hash
hash = decodeURIComponent(hash); hash = decodeURIComponent(hash);
var fixedTabs = document.querySelector('.js-tabs-affix'); const fixedTabs = document.querySelector('.js-tabs-affix');
var fixedNav = document.querySelector('.navbar-gitlab'); const fixedDiffStats = document.querySelector('.js-diff-files-changed.is-stuck');
const fixedNav = document.querySelector('.navbar-gitlab');
var adjustment = 0; var adjustment = 0;
if (fixedNav) adjustment -= fixedNav.offsetHeight; if (fixedNav) adjustment -= fixedNav.offsetHeight;
...@@ -104,6 +105,11 @@ ...@@ -104,6 +105,11 @@
if (fixedTabs) { if (fixedTabs) {
adjustment -= fixedTabs.offsetHeight; adjustment -= fixedTabs.offsetHeight;
} }
if (fixedDiffStats) {
adjustment -= fixedDiffStats.offsetHeight;
}
window.scrollBy(0, adjustment); window.scrollBy(0, adjustment);
} }
}; };
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
Showing Showing
%button.diff-stats-summary-toggler.js-diff-stats-dropdown{ type: "button", data: { toggle: "dropdown" } }< %button.diff-stats-summary-toggler.js-diff-stats-dropdown{ type: "button", data: { toggle: "dropdown" } }<
= pluralize(diff_files.size, "changed file") = pluralize(diff_files.size, "changed file")
= icon("caret-down fw") = icon("caret-down", class: "prepend-left-5")
%span.diff-stats-additions-deletions-expanded#diff-stats %span.diff-stats-additions-deletions-expanded#diff-stats
with with
%strong.cgreen #{sum_added_lines} additions %strong.cgreen #{sum_added_lines} additions
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
%strong.cred< %strong.cred<
\-#{sum_removed_lines} \-#{sum_removed_lines}
.dropdown-menu.diff-file-changes .dropdown-menu.diff-file-changes
= dropdown_filter("Search file") = dropdown_filter("Search files")
.dropdown-content .dropdown-content
%ul %ul
- diff_files.each do |diff_file| - diff_files.each do |diff_file|
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment