Skip to content

pantoken / formats/interactions/src / initModal

Συνάρτηση: initModal()

initModal(host, dialog, onCommand): void

Συνδέστε ένα CSS <dialog class="instui-modal"> ή τη σκιά ενός web component <dialog> με το πρωτόκολλο χαρακτηριστικού open και τη δρομολόγηση εντολών --show/--close/--toggle. Και οι δύο χρήσεις μεταβιβάζουν την ίδια διεπαφή:

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

Παράμετροι

host

HTMLElement

dialog

HTMLDialogElement

onCommand

OnCommand

Επιστρέφει

void