Skip to content

pantoken / formats/interactions/src / initModal

Fonction: initModal()

initModal(host, dialog, onCommand): void

Connecter un <dialog class="instui-modal"> CSS ou le shadow d'un composant web <dialog> au protocole d'attribut open et au routage de commande --show/--close/--toggle. Les deux usages transmettent la même interface :

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

Paramètres

host

HTMLElement

dialog

HTMLDialogElement

onCommand

OnCommand

Retourne

void