sdk: update op.js script

This commit is contained in:
Carl-Gerhard Lindesvärd
2024-03-24 18:26:28 +01:00
parent 13c2d20961
commit f258bad2aa
3 changed files with 5 additions and 5 deletions

View File

@@ -114,11 +114,11 @@ export class Openpanel extends OpenpanelSdk<OpenpanelOptions> {
document.addEventListener('click', (event) => {
const target = event.target as HTMLElement;
const btn = target.closest('button');
const achor = target.closest('button');
const anchor = target.closest('a');
const element = btn?.getAttribute('data-event')
? btn
: achor?.getAttribute('data-event')
? achor
: anchor?.getAttribute('data-event')
? anchor
: null;
if (element) {
const properties: Record<string, unknown> = {};