blob: 140ad264e96c991c7761ebce3b247874f0a05814 (
plain)
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
|
# Menuitem
[](https://travis-ci.org/jetpack-labs/menuitem)
[](https://nodei.co/npm/menuitem/)
[](https://nodei.co/npm/menuitem)
The menuitems API is a simple way to create a menuitem,
which can perform an action when clicked, and display state.
## Example
// create menuitem for the File menu,
// and insert it before the 'Quit' menuitem
require("menuitem").Menuitem({
id: "myextprefix-some-mi-id",
menuid: "menu_FilePopup",
insertbefore: "menu_FileQuitItem",
"label": _("label"),
"accesskey": _("label.ak"),
image: self.data.url("icon.png"),
className: 'pizazz',
disabled: false,
checked: false,
onCommand: function() {
// do something
}
});
|