aboutsummaryrefslogtreecommitdiff
path: root/src/view/components/modal.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/view/components/modal.ts')
-rw-r--r--src/view/components/modal.ts12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/view/components/modal.ts b/src/view/components/modal.ts
index 95f907c..5e845e1 100644
--- a/src/view/components/modal.ts
+++ b/src/view/components/modal.ts
@@ -1,15 +1,19 @@
import { h, Html } from 'lib/rx'
interface Params {
- header: Html,
- body: Html,
+ header: Html
+ body: Html
onClose: () => void
+ onmount?: (element: Element) => void
+ onunmount?: (element: Element) => void
}
-export function view({ header, body, onClose }: Params): Html {
+export function view({ header, body, onClose, onmount, onunmount }: Params): Html {
return h('div',
{ className: 'g-Modal',
- onclick: () => onClose()
+ onclick: () => onClose(),
+ onmount: (element: Element) => onmount && onmount(element),
+ onunmount: (element: Element) => onunmount && onunmount(element)
},
h('div',
{ className: 'g-Modal__Content',