From d2b915f6c25f7a7333917054f0835aefd19322b8 Mon Sep 17 00:00:00 2001 From: checktheroads Date: Thu, 22 Apr 2021 18:56:37 -0700 Subject: [PATCH] add typed wrapper around document.getElementById --- netbox/project-static/src/util.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/netbox/project-static/src/util.ts b/netbox/project-static/src/util.ts index a74e290e4..d43c3af25 100644 --- a/netbox/project-static/src/util.ts +++ b/netbox/project-static/src/util.ts @@ -148,6 +148,10 @@ export function* getElements( } } +export function getElement(id: string): Nullable { + return document.getElementById(id) as Nullable; +} + /** * 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