Allow items to be assigned to multiple popovers

This commit is contained in:
Samuel Attard 2017-03-27 21:10:14 +11:00 committed by Kevin Sawicki
parent f05dfc74da
commit 2fd62d090a
2 changed files with 33 additions and 23 deletions

View file

@ -223,7 +223,10 @@ TouchBar.TouchBarPopover = class TouchBarPopover extends TouchBarItem {
if (!(this.child instanceof TouchBar)) {
this.child = new TouchBar(this.child)
}
this.child.ordereredItems.forEach((item) => item._popover = this.id)
this.child.ordereredItems.forEach((item) => {
item._popover = item._popover || []
if (!item._popover.find(itemID => itemID === this.id)) item._popover.push(this.id)
})
}
}