MediaWiki:Common.js: Difference between revisions

Fix setStickyHeaderTop
(Fix sticky header on mobile resolutions (take 2))
(Fix setStickyHeaderTop)
Line 525: Line 525:
   const headStyles = getComputedStyle(document.getElementById('mw-header-container'));
   const headStyles = getComputedStyle(document.getElementById('mw-header-container'));
   var headHeight = document.getElementById('mw-header-container').offsetHeight;
   var headHeight = document.getElementById('mw-header-container').offsetHeight;
   if (headStyles !== undefined && headStyles.display !== 'fixed') {
   if (headStyles !== undefined && headStyles.position === 'static') {
     headHeight = 0;
     headHeight = 0;
   }
   }