summaryrefslogtreecommitdiff
path: root/app/assets/javascripts
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2017-08-29 16:15:20 +0000
committerFilipa Lacerda <filipa@gitlab.com>2017-08-29 16:15:20 +0000
commit8e60636984d9f559f7e3cceee04be599b0df583f (patch)
treeb121ad6af7c780335d3a6a8808b3bd7fa1c18134 /app/assets/javascripts
parent0229ab481488d0a2a900474cee8b51a5129a87dc (diff)
parentab3c8302afdbbcd608e2768f9db5e53ec4358512 (diff)
downloadgitlab-ce-8e60636984d9f559f7e3cceee04be599b0df583f.tar.gz
Merge branch 'changes-bar-sticky-fix' into 'master'
Fixes the diff changes buttons from toggling when scrolling Closes #36698 See merge request !13894
Diffstat (limited to 'app/assets/javascripts')
-rw-r--r--app/assets/javascripts/lib/utils/sticky.js2
-rw-r--r--app/assets/javascripts/merge_request_tabs.js1
2 files changed, 2 insertions, 1 deletions
diff --git a/app/assets/javascripts/lib/utils/sticky.js b/app/assets/javascripts/lib/utils/sticky.js
index ff2b66046b4..283c0ec0410 100644
--- a/app/assets/javascripts/lib/utils/sticky.js
+++ b/app/assets/javascripts/lib/utils/sticky.js
@@ -1,5 +1,5 @@
export const isSticky = (el, scrollY, stickyTop) => {
- const top = el.offsetTop - scrollY;
+ const top = Math.floor(el.offsetTop - scrollY);
if (top <= stickyTop) {
el.classList.add('is-stuck');
diff --git a/app/assets/javascripts/merge_request_tabs.js b/app/assets/javascripts/merge_request_tabs.js
index 5a9b3d19f84..3b3620fe61b 100644
--- a/app/assets/javascripts/merge_request_tabs.js
+++ b/app/assets/javascripts/merge_request_tabs.js
@@ -253,6 +253,7 @@ import bp from './breakpoints';
loadDiff(source) {
if (this.diffsLoaded) {
+ document.dispatchEvent(new CustomEvent('scroll'));
return;
}