PhotonUI logo

PhotonUI

A javascript framework to create user interfaces

PopupMenu

Class Reference

More examples

Contextual menu

Contextual menus on PhotonUI widgets are automatically managed:

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
var popup = new photonui.PopupMenu({
children: [
new photonui.MenuItem({
text: "Menu Item 1",
icon: new photonui.FAIcon("fa-paper-plane"),
callbacks: {
click: function(widget, event) {
alert("You clicked on me!");
}
}
}),
new photonui.MenuItem({
text: "Menu Item 2",
icon: new photonui.FAIcon("fa-gears")
}),
new photonui.MenuItem({
text: "Menu Item 3",
icon: new photonui.FAIcon("fa-paw")
})
]
});
var button = new photonui.Button({
text: "Right click on me!",
buttonColor: "blue",
contextMenu: popup // Defines the context menu
// displayed on right click
});
photonui.domInsert(button, "demo");