Anonymous

MediaWiki:Common.js: Difference between revisions

From Melvor Idle
Changed header rows classnames to headerRow -0 and -1 for future proofing
(Added code to resize. Only applies when stickyHeader tables are on the page.)
(Changed header rows classnames to headerRow -0 and -1 for future proofing)
Line 6: Line 6:
   const headHeight = document.getElementById('mw-header-container').offsetHeight;
   const headHeight = document.getElementById('mw-header-container').offsetHeight;
   for (var i = 0; i < stickyTables.length; i++) {
   for (var i = 0; i < stickyTables.length; i++) {
     const firstRow = stickyTables[i].getElementsByClassName('firstHeaderRow');
     const firstRow = stickyTables[i].getElementsByClassName('headerRow-0');
     const secondRow = stickyTables[i].getElementsByClassName('secondHeaderRow');
     const secondRow = stickyTables[i].getElementsByClassName('headerRow-1');
     var firstHeight = 0;
     var firstHeight = 0;
     if (firstRow.length > 0) {
     if (firstRow.length > 0) {