Skip to content

pantoken / formats/interactions/src / initModal

Funktion: initModal()

initModal(host, dialog, onCommand): void

Anslut en CSS <dialog class="instui-modal"> eller en webbkomponents skugga <dialog> till open-attributprotokollet och --show/--close/--toggle kommandorouting. Båda användningarna skickar samma gränssnitt:

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

Parametrar

host

HTMLElement

dialog

HTMLDialogElement

onCommand

OnCommand

Returnerar

void