From 68d937ed47b73cc9ea2217291e6d02fd0d5b66c7 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 7 Dec 2015 11:20:15 -0800 Subject: [PATCH] :art: --- atom/browser/api/lib/menu-item.coffee | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/atom/browser/api/lib/menu-item.coffee b/atom/browser/api/lib/menu-item.coffee index 86b5c190d69e..242a48f54d88 100644 --- a/atom/browser/api/lib/menu-item.coffee +++ b/atom/browser/api/lib/menu-item.coffee @@ -24,13 +24,10 @@ class MenuItem constructor: (options) -> {Menu} = require 'electron' - {click, @selector, @type, @role, @label, @sublabel, @accelerator, @icon, @enabled, @visible, @checked} = options + {click, @selector, @type, @role, @label, @sublabel, @accelerator, @icon, @enabled, @visible, @checked, @submenu} = options - if options.submenu? - if options.submenu.constructor is Menu - @submenu = options.submenu - else - @submenu = Menu.buildFromTemplate options.submenu + if @submenu? and @submenu.constructor isnt Menu + @submenu = Menu.buildFromTemplate @submenu @type = 'submenu' if not @type? and @submenu? throw new Error('Invalid submenu') if @type is 'submenu' and @submenu?.constructor isnt Menu