aboutsummaryrefslogtreecommitdiff
path: root/src/view/components
diff options
context:
space:
mode:
authorJoris2023-09-13 09:28:23 +0200
committerJoris2023-09-13 09:28:23 +0200
commit3cb3108646f81ea838a03923d9d51895e61fdb74 (patch)
treef6790e655dee63639f1a771eade1cf68a00c3508 /src/view/components
parentc8ffa6722ef948879fa6ed9642ad134a2193fa4b (diff)
Go to previous or next book with left and right
Diffstat (limited to 'src/view/components')
-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',