diff --git a/src/atom-package.coffee b/src/atom-package.coffee index 588be8e91..5915a559d 100644 --- a/src/atom-package.coffee +++ b/src/atom-package.coffee @@ -92,6 +92,7 @@ class AtomPackage extends Package activateResources: -> keymap.add(keymapPath, map) for [keymapPath, map] in @keymaps atom.contextMenu.add(menuPath, map['context-menu']) for [menuPath, map] in @menus + atom.menu.add(map.menu) for [menuPath, map] in @menus when map.menu syntax.addGrammar(grammar) for grammar in @grammars for [scopedPropertiesPath, selector, properties] in @scopedProperties syntax.addProperties(scopedPropertiesPath, selector, properties) diff --git a/src/menu-manager.coffee b/src/menu-manager.coffee index 45d6bb6fa..decf508c7 100644 --- a/src/menu-manager.coffee +++ b/src/menu-manager.coffee @@ -24,8 +24,8 @@ class MenuManager # https://github.com/atom/atom-shell/blob/master/docs/api/browser/menu.md # # Returns nothing. - add: (item) -> - @merge(@template, item) + add: (items) -> + @merge(@template, item) for item in items # Public: Refreshes the currently visible menu. update: -> @@ -36,7 +36,7 @@ class MenuManager menuPaths = fsUtils.listSync(atom.config.bundledMenusDirPath, ['cson', 'json']) for menuPath in menuPaths data = CSON.readFileSync(menuPath) - @add(item) for item in data.menu + @add(data.menu) # Private: Merges an item in a menu aware way such that new items are always # appended to the bottom.