From 3cb3108646f81ea838a03923d9d51895e61fdb74 Mon Sep 17 00:00:00 2001 From: Joris Date: Wed, 13 Sep 2023 09:28:23 +0200 Subject: Go to previous or next book with left and right --- src/view/components/modal.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/view/components') 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', -- cgit v1.2.3