Skip to content

pantoken / formats/interactions/src / initModal

Funksjon: initModal()

initModal(host, dialog, onCommand): void

Kople ein CSS <dialog class="instui-modal"> eller eit webkomponents shadow <dialog> til open-attributtprotokollen og --show/--close/--toggle kommandoruting. Begge bruksformene gir same grensesnitt:

  • 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

Returnerer

void