Skip to content

pantoken / formats/interactions/src / initModal

Funktion: initModal()

initModal(host, dialog, onCommand): void

Verbinde ein CSS <dialog class="instui-modal"> oder den Shadow einer Webkomponente <dialog> mit dem open-Attributprotokoll und der --show/--close/--toggle Befehlsweiterleitung. Beide Verwendungsweisen übergeben dieselbe Schnittstelle:

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

Parameter

host

HTMLElement

dialog

HTMLDialogElement

onCommand

OnCommand

Rückgabe

void