MediaWiki:Common.js: Difference between revisions

Undo revision 56082 by Auron956 (talk)
(Fix sticky header on mobile resolutions)
Tag: Reverted
(Undo revision 56082 by Auron956 (talk))
Tag: Undo
Line 523: Line 523:
function setStickyHeaderTop() {
function setStickyHeaderTop() {
   const stickyTables = document.getElementsByClassName('stickyHeader');
   const stickyTables = document.getElementsByClassName('stickyHeader');
   const headStyles = getComputedStyle(document.getElementById('mw-header-container'));
   const headHeight = document.getElementById('mw-header-container').offsetHeight;
  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');