npm.io
0.7.0 • Published 6 months ago

makeup-dialog

Licence
MIT
Version
0.7.0
Deps
2
Size
17 kB
Vulns
0
Weekly
0
Stars
47

makeup-dialog

Abstract class representing the base behaviour for a modal or non-modal ARIA dialog.

CSS

No CSS is provided.

JavaScript

import Dialog from "makeup-dialog";

// non-modal (default)
document.querySelectorAll(".my-non-modal-dialog").forEach(function (el, i) {
  const widget = new Dialog(el);
});

// modal
document.querySelectorAll(".my-modal-dialog").forEach(function (el, i) {
  const widget = new Dialog(el, { modal: true });
});

Config

The constructor takes a configuration object as its second parameter.

todo

Events

makeup-dialog-open

Fired when any dialog is opened.

makeup-dialog-close

Fired when any dialog is closed.