Implement group item

This commit is contained in:
Samuel Attard 2016-11-29 18:36:57 +11:00 committed by Kevin Sawicki
parent 269d899a99
commit 43cc5079d8
3 changed files with 62 additions and 13 deletions

View file

@ -74,6 +74,20 @@ TouchBar.ColorPicker = class TouchBarColorPicker extends TouchBarItem {
}
}
TouchBar.Group = class TouchBarGroup extends TouchBarItem {
constructor (config) {
super(config)
this.config.type = 'group'
}
toJSON () {
const config = this.config;
return Object.assign({}, config, {
items: config.items && config.items.toJSON ? config.items.toJSON() : []
})
}
}
TouchBar.Label = class TouchBarLabel extends TouchBarItem {
constructor (config) {
super(config)
@ -81,13 +95,6 @@ TouchBar.Label = class TouchBarLabel extends TouchBarItem {
}
}
TouchBar.List = class TouchBarList extends TouchBarItem {
constructor (config) {
super(config)
this.config.type = 'list'
}
}
TouchBar.PopOver = class TouchBarPopOver extends TouchBarItem {
constructor (config) {
super(config)