Enable to attach extra fields to menu items.

This commit is contained in:
Cheng Zhao 2013-08-14 11:00:08 +08:00
parent 452c350798
commit c6f18f095e

View file

@ -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