17,097
edits
(Sticky headers: Try using mutation observers, as on load events don't resolve the issue (they fire after the issue occurs?)) |
(Sticky headers: Try ResizeObserver instead of MutationObserver (cannot observe a computed style change)) |
||
Line 524: | Line 524: | ||
function setStickyHeaderTop(addObservers) { | function setStickyHeaderTop(addObservers) { | ||
var observer = null; | var observer = null; | ||
if ((addObservers) && (ResizeObserver !== undefined)) { | |||
if (addObservers) { | observer = new ResizeObserver( | ||
observer = new | function(entries) { | ||
function( | setStickyHeaderTop(false); | ||
}); | }); | ||
} | } | ||
Line 549: | Line 543: | ||
firstHeight = firstRow[0].offsetHeight; | firstHeight = firstRow[0].offsetHeight; | ||
if (addObservers) { | if (addObservers) { | ||
observer.observe(firstRow[0] | observer.observe(firstRow[0]); | ||
} | } | ||
var firstHeaders = firstRow[0].getElementsByTagName('th'); | var firstHeaders = firstRow[0].getElementsByTagName('th'); |