Update dom.ts

pull/5524/head
pushkin 5 years ago committed by GitHub
parent ebbbc0d298
commit 5cfff8d6d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -260,6 +260,11 @@ export function is_crossorigin() {
}
export function add_resize_listener(node: HTMLElement, fn: () => void) {
if ('ResizeObserver' in window) {
const obs = new ResizeObserver(fn);
obs.observe(node);
return obs.disconnect.bind(obs);
}
const computed_style = getComputedStyle(node);
const z_index = (parseInt(computed_style.zIndex) || 0) - 1;

Loading…
Cancel
Save