mirror of
https://github.com/utterance/utterances.git
synced 2024-09-11 07:15:28 +03:00
intercept load event
This commit is contained in:
parent
ba38a1e67a
commit
e66322d089
@ -8,7 +8,7 @@ let hostOrigin: string;
|
||||
export function startMeasuring(origin: string) {
|
||||
hostOrigin = origin;
|
||||
addEventListener('resize', scheduleMeasure);
|
||||
addEventListener('load', scheduleMeasure);
|
||||
addEventListener('load', scheduleMeasure, true);
|
||||
}
|
||||
|
||||
let lastHeight = -1;
|
||||
@ -27,5 +27,5 @@ let publishTimeout = 0;
|
||||
|
||||
export function scheduleMeasure() {
|
||||
clearTimeout(publishTimeout);
|
||||
publishTimeout = setTimeout(measure);
|
||||
publishTimeout = setTimeout(measure, 50);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user