-
-
Notifications
You must be signed in to change notification settings - Fork 162
/
Copy pathdialog.js
32 lines (27 loc) · 802 Bytes
/
dialog.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// ダイアログを生成する
const showDialogY = (text) => {
// create the dialog
let dialog = document.createElement("dialog");
// main container
let container = document.createElement("div");
container.style.minWidth = 400;
container.style.padding = 40;
// add content
let title = document.createElement("h3");
title.style.padding = 20;
title.textContent = text;
container.appendChild(title);
// close button
let closeButton = document.createElement("button");
closeButton.textContent = "Yes";
container.appendChild(closeButton);
closeButton.onclick = (e) => {
dialog.close();
}
document.body.appendChild(dialog);
dialog.appendChild(container);
dialog.showModal()
}
module.exports = {
showDialogY
}