Use - as filename seperator for coffee script files. Fixes #15.
Also clean unused files and wrong file names.
This commit is contained in:
parent
9ea1f9956e
commit
bb69d99423
15 changed files with 28 additions and 39 deletions
29
browser/api/lib/menu-item.coffee
Normal file
29
browser/api/lib/menu-item.coffee
Normal file
|
@ -0,0 +1,29 @@
|
|||
nextCommandId = 0
|
||||
|
||||
class MenuItem
|
||||
@types = ['normal', 'separator', 'submenu', 'checkbox', 'radio']
|
||||
|
||||
constructor: (options) ->
|
||||
Menu = require 'menu'
|
||||
|
||||
{click, selector, @type, @label, @sublabel, @accelerator, @enabled, @visible, @checked, @groupId, @submenu} = options
|
||||
|
||||
@type = 'submenu' if not @type? and @submenu?
|
||||
throw new Error('Invalid submenu') if @type is 'submenu' and @submenu?.constructor isnt Menu
|
||||
|
||||
@type = @type ? 'normal'
|
||||
@label = @label ? ''
|
||||
@sublabel = @sublabel ? ''
|
||||
@enabled = @enabled ? true
|
||||
@visible = @visible ? true
|
||||
|
||||
throw new Error('Unknown menu type') if MenuItem.types.indexOf(@type) is -1
|
||||
|
||||
@commandId = ++nextCommandId
|
||||
@click = ->
|
||||
if typeof click is 'function'
|
||||
click()
|
||||
else if typeof selector is 'string'
|
||||
Menu.sendActionToFirstResponder selector
|
||||
|
||||
module.exports = MenuItem
|
Loading…
Add table
Add a link
Reference in a new issue