mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2026-01-27 01:44:31 +01:00
Sticky header JS fix
The old version lead to an error on pages that do not contain a sticky header.
This commit is contained in:
committed by
Andrew Camilleri
parent
248be11e4d
commit
2976edf333
@@ -1,7 +1,9 @@
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
// sticky header
|
||||
const { offsetHeight } = document.querySelector('.sticky-header-setup + .sticky-header');
|
||||
document.documentElement.style.scrollPaddingTop = `calc(${offsetHeight}px + var(--btcpay-space-m))`;
|
||||
const stickyHeader = document.querySelector('.sticky-header-setup + .sticky-header');
|
||||
if (stickyHeader) {
|
||||
document.documentElement.style.scrollPaddingTop = `calc(${stickyHeader.offsetHeight}px + var(--btcpay-space-m))`;
|
||||
}
|
||||
|
||||
// initialize timezone offset value if field is present in page
|
||||
var timezoneOffset = new Date().getTimezoneOffset();
|
||||
|
||||
Reference in New Issue
Block a user