generated from ZEISS/template-element
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c03a7f0
commit e49640c
Showing
2 changed files
with
3 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,8 +54,6 @@ export class HTMXToastsElement extends HTMLElement { | |
notifications = new Array<Notification>() | ||
|
||
connectedCallback(): void { | ||
window.addEventListener('htmx-toasts:notify', ((e: CustomEvent<Notify>) => this.addToast(e)) as EventListener) | ||
|
||
if (!this.hasAttribute('role')) { | ||
this.setAttribute('role', 'alert') | ||
} | ||
|
@@ -75,6 +73,8 @@ export class HTMXToastsElement extends HTMLElement { | |
styles.href = 'https://unpkg.com/[email protected]/dist/out.css' | ||
styles.type = 'text/css' | ||
this.shadowRoot?.appendChild(styles) | ||
|
||
window.addEventListener('htmx-toasts:notify', ((e: CustomEvent<Notify>) => this.addToast(e)) as EventListener) | ||
} | ||
|
||
disconnectedCallback(): void { | ||
|