17,097
edits
(Amend dark mode code) |
(Fix sticky header on mobile resolutions) Tag: Reverted |
||
Line 523: | Line 523: | ||
function setStickyHeaderTop() { | function setStickyHeaderTop() { | ||
const stickyTables = document.getElementsByClassName('stickyHeader'); | const stickyTables = document.getElementsByClassName('stickyHeader'); | ||
const headHeight = document.getElementById('mw-header-container').offsetHeight; | const headStyles = getComputedStyle(document.getElementById('mw-header-container')); | ||
let headHeight = document.getElementById('mw-header-container').offsetHeight; | |||
if (headStyles !== undefined && headStyles.display !== 'fixed') { | |||
headHeight = 0; | |||
} | |||
for (var i = 0; i < stickyTables.length; i++) { | for (var i = 0; i < stickyTables.length; i++) { | ||
const firstRow = stickyTables[i].getElementsByClassName('headerRow-0'); | const firstRow = stickyTables[i].getElementsByClassName('headerRow-0'); |