Skip to content

Commit

Permalink
Enable to attach extra fields to menu items.
Browse files Browse the repository at this point in the history
  • Loading branch information
zcbenz committed Aug 14, 2013
1 parent 452c350 commit c6f18f0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion browser/api/lib/menu.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ Menu.buildFromTemplate = (template) ->
throw new TypeError('Invalid template for MenuItem') unless typeof item is 'object'

item.submenu = Menu.buildFromTemplate item.submenu if item.submenu?
menu.append new MenuItem(item)
menuItem = new MenuItem(item)
menuItem[key] = value for key, value of item

menu.append menuItem

menu

Expand Down

0 comments on commit c6f18f0

Please sign in to comment.