mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 12:53:42 +08:00
FIX: --header-offset didn't account for overscroll (#15221)
Fixes miniprofiler badge sliding away from the header when you rubber-band overscroll on the top of the page (in Safari)
This commit is contained in:
parent
f26b8b448d
commit
301d5657fe
|
@ -183,9 +183,13 @@ const SiteHeaderComponent = MountWidget.extend(
|
|||
}
|
||||
|
||||
const offset = info.offset();
|
||||
const headerRect = header.getBoundingClientRect(),
|
||||
headerOffset = headerRect.top + headerRect.height,
|
||||
doc = document.documentElement;
|
||||
const headerRect = header.getBoundingClientRect();
|
||||
const doc = document.documentElement;
|
||||
let headerOffset = headerRect.top + headerRect.height;
|
||||
|
||||
if (window.scrollY < 0) {
|
||||
headerOffset -= window.scrollY;
|
||||
}
|
||||
|
||||
const newValue = `${headerOffset}px`;
|
||||
if (newValue !== this.currentHeaderOffsetValue) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user