mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-24 09:28:38 -06:00
add typed wrapper around document.getElementById
This commit is contained in:
parent
7920eff672
commit
d2b915f6c2
@ -148,6 +148,10 @@ export function* getElements(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getElement<E extends HTMLElement>(id: string): Nullable<E> {
|
||||||
|
return document.getElementById(id) as Nullable<E>;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* scrollTo() wrapper that calculates a Y offset relative to `element`, but also factors in an
|
* scrollTo() wrapper that calculates a Y offset relative to `element`, but also factors in an
|
||||||
* offset relative to div#content-title. This ensures we scroll to the element, but leave enough
|
* offset relative to div#content-title. This ensures we scroll to the element, but leave enough
|
||||||
|
Loading…
Reference in New Issue
Block a user