From 15bba899c326a30d21fd7d1bdbaec4afe44e47f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Sun, 12 Jun 2022 03:25:56 +0200 Subject: Replace some .tagName with instanceof. --- static/server_connect.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'static/server_connect.ts') diff --git a/static/server_connect.ts b/static/server_connect.ts index 61eb4f30..d1a544eb 100644 --- a/static/server_connect.ts +++ b/static/server_connect.ts @@ -4,6 +4,7 @@ import { jcal_to_xcal } from './jcal' import { VEvent } from './vevent' import { uid } from './types' import { vcal_objects } from './globals' +import { PopupElement } from './components/popup-element' async function remove_event(uid: uid) { let element = vcal_objects.get(uid); @@ -124,7 +125,7 @@ async function create_event(event: VEvent) { for (let r of event.registered) { r.classList.remove('generated'); - if (r.tagName.toLowerCase() === 'popup-element') { + if (r instanceof PopupElement) { console.log(r); r.removeAttribute('visible'); } -- cgit v1.2.3