MediaWiki:Common.js: Difference between revisions

Sticky headers: Fixes for overflow handling
(Rewrite sticky headers code - Corrects issue with sticky headers within overflown tables, and only updates the relevant tables' headers upon resize)
(Sticky headers: Fixes for overflow handling)
Line 571: Line 571:
if ((isOverflown) && (cell.style.top !== undefined)) {
if ((isOverflown) && (cell.style.top !== undefined)) {
// If the table has overflown, then unset the 'top' attribute
// If the table has overflown, then unset the 'top' attribute
cell.removeAttribute('top');
cell.style.top = '';
}
}
else {
else {
// Otherwise, set the 'top' attribute with the appropriate position
// Otherwise, set the 'top' attribute with the appropriate position
cellElems[cellIdx].style.top = topPos.toString() + 'px';
cell.style.top = topPos.toString() + 'px';
}
}
}
}