You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mozilla-labs-jetpack
I want to create a menu item that has sub menu items - is this
possible? It seems better than adding a bunch of top level menu items
just for one "app".
Drew
unread,
Nov 20, 2009, 4:51:10 PM11/20/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mozilla-la...@googlegroups.com
Try the "menu" property of menuitems:
var menuitem = {
label: "Submenu",
menu: new jetpack.Menu([
{ label: "Another Submenu!", menu: new jetpack.Menu(...) }
])
};
jetpack.menu.set(menuitem);
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mozilla-la...@googlegroups.com
Is there any reason why we have to make that extra object? Should this be able to work too?
var menuitem = { label: "Submenu",
menu: [
{ label: "Another Submenu!", menu: new jetpack.Menu(...) }
]
}; jetpack.menu.set(menuitem);
-- aza | ɐzɐ --
Drew
unread,
Nov 20, 2009, 8:59:52 PM11/20/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mozilla-la...@googlegroups.com
Yeah, I've had the same thought. The reason the jetpack.Menu
constructor exists is because menus have specialized methods. So you
can for example:
var myMenu = new jetpack.Menu();
myMenu.add("foo");
jetpack.menu.set({ label: "My Menu", menu: myMenu });
We could just box the |menu| value if it's not already a jetpack.Menu,
but I chose not to because in one sense it's more complex: Sometimes
you have to write jetpack.Menu, sometimes you don't. But you're right,
it does make code more terse if you don't have to write it.