PhotonUI logo

PhotonUI

A javascript framework to create user interfaces

Dialog

Class Reference

More examples

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
33
34
// Get the position of the #demo area to display windows
// in the right place
var pos = photonui.Helpers.getAbsolutePosition("demo");

new photonui.Dialog({
title: "My Modal Dialog",
visible: true,
x: pos.x, y: pos.y,
child: new photonui.Label("Do you want to close this dialog?"),
modal: true,
padding: 10,
buttons: [
new photonui.Button({
leftIcon: new photonui.FAIcon("fa-check"),
text: "Yes",
buttonColor: "green",
callbacks: {
click: function(widget, event) {
widget.parent.destroy();
}
}
}),
new photonui.Button({
leftIcon: new photonui.FAIcon("fa-times"),
text: "Nope",
buttonColor: "red"
})
],
callbacks: {
"close-button-clicked": function(widget) {
widget.destroy();
}
}
});