Skip to content

pantoken / formats/interactions/src / initModal

Funksjon: initModal()

initModal(host, dialog, onCommand): void

Koble en CSS <dialog class="instui-modal"> eller en webkomponents shadow <dialog> til open-attributtprotokollen og --show/--close/--toggle kommando-ruting. Begge bruksområdene leverer samme grensesnitt:

  • CSS: host === dialog (the dialog itself carries the id and open attr)
  • WC: host = custom element, dialog = its shadow &lt;dialog&gt;

Parametere

host

HTMLElement

dialog

HTMLDialogElement

onCommand

OnCommand

Returnerer

void