|
@@ -235,8 +235,8 @@ TouchBar.TouchBarScrubber = class TouchBarScrubber extends TouchBarItem {
|
|
|
constructor (config) {
|
|
|
super()
|
|
|
if (config == null) config = {}
|
|
|
- const {items} = config
|
|
|
- let {onSelect, onHighlight, selectedStyle, highlightedStyle, showArrowButtons, continuous, mode} = config
|
|
|
+ const {items, selectedStyle, highlightedStyle, showArrowButtons, continuous, mode} = config
|
|
|
+ let {select, highlight} = config
|
|
|
this.type = 'scrubber'
|
|
|
this._addLiveProperty('items', items)
|
|
|
this._addLiveProperty('selectedStyle', selectedStyle || null)
|
|
@@ -245,14 +245,14 @@ TouchBar.TouchBarScrubber = class TouchBarScrubber extends TouchBarItem {
|
|
|
this._addLiveProperty('mode', mode || 'free')
|
|
|
this._addLiveProperty('continuous', continuous || true)
|
|
|
|
|
|
- if (typeof onSelect === 'function' || typeof onHighlight === 'function') {
|
|
|
- if (onSelect == null) onSelect = () => {}
|
|
|
- if (onHighlight == null) onHighlight = () => {}
|
|
|
+ if (typeof select === 'function' || typeof highlight === 'function') {
|
|
|
+ if (select == null) select = () => {}
|
|
|
+ if (highlight == null) highlight = () => {}
|
|
|
this.onInteraction = (details) => {
|
|
|
if (details.type === 'select') {
|
|
|
- onSelect(details.selectedIndex)
|
|
|
+ select(details.selectedIndex)
|
|
|
} else if (details.type === 'highlight') {
|
|
|
- onHighlight(details.highlightedIndex)
|
|
|
+ highlight(details.highlightedIndex)
|
|
|
}
|
|
|
}
|
|
|
}
|