Make sure all MenuItem's options have a default value.
This commit is contained in:
		
					parent
					
						
							
								2fd91e8c96
							
						
					
				
			
			
				commit
				
					
						ee2c696577
					
				
			
		
					 1 changed files with 4 additions and 0 deletions
				
			
		| 
						 | 
					@ -14,8 +14,12 @@ class MenuItem
 | 
				
			||||||
    @type = @type ? 'normal'
 | 
					    @type = @type ? 'normal'
 | 
				
			||||||
    @label = @label ? ''
 | 
					    @label = @label ? ''
 | 
				
			||||||
    @sublabel = @sublabel ? ''
 | 
					    @sublabel = @sublabel ? ''
 | 
				
			||||||
 | 
					    @accelerator = @accelerator ? null
 | 
				
			||||||
    @enabled = @enabled ? true
 | 
					    @enabled = @enabled ? true
 | 
				
			||||||
    @visible = @visible ? true
 | 
					    @visible = @visible ? true
 | 
				
			||||||
 | 
					    @checked = @checked ? false
 | 
				
			||||||
 | 
					    @groupId = @groupId ? null
 | 
				
			||||||
 | 
					    @submenu = @submenu ? null
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    throw new Error('Unknown menu type') if MenuItem.types.indexOf(@type) is -1
 | 
					    throw new Error('Unknown menu type') if MenuItem.types.indexOf(@type) is -1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue