ダイアログを表示 [1.1.2]

概要

ポップアップでダイアログを表示する。
フッターボタンのデフォルトイベントを「閉じる」

head内に追記

<script charset="UTF-8" src="dialog.js"></script>

使い方:ダイアログを開く

const D = new Dialog();
D.open(inObj);
inObj.header {?object}
ヘッダーに表示させるもの
inObj.header.subject {?string}
件名
inObj.body {object}
メイン部分に表示させるもの
inObj.body.html {string}
本文
inObj.footer {?object}
フッター部分に表示させるもの
inObj.footer.buttons {?object[]}
ボタン配列
inObj.footer.buttons[].text {?string}
表示文言
inObj.footer.buttons[].click {?callback}
クリック時のコールバック
inObj.footer.buttons[].class {?string[]}
追加するクラス名
inObj.footer.buttons[].disabled {?boolean}
非活性化

使い方:ダイアログを閉じる

D.close();

使い方:ダイアログの本文要素を取得する

const bodyElement = D.getBodyElement();

使い方:ダイアログのボタン要素を取得する

const buttonElements = D.getButtonElements();

デモ