From c6f18f095ef179d1c2acab467b27a737c50a5977 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Wed, 14 Aug 2013 11:00:08 +0800 Subject: [PATCH] Enable to attach extra fields to menu items. --- browser/api/lib/menu.coffee | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/browser/api/lib/menu.coffee b/browser/api/lib/menu.coffee index ab6bb65fbb86..d666b2cab622 100644 --- a/browser/api/lib/menu.coffee +++ b/browser/api/lib/menu.coffee @@ -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