Add more options

This commit is contained in:
Samuel Attard 2017-03-14 18:57:57 +11:00
parent 5e70adb511
commit a55cddaa53
No known key found for this signature in database
GPG key ID: E89DDE5742D58C4E
3 changed files with 85 additions and 3 deletions

View file

@ -236,9 +236,14 @@ TouchBar.TouchBarScrubber = class TouchBarScrubber extends TouchBarItem {
super()
if (config == null) config = {}
const {items} = config
let {onSelect, onHighlight} = config
let {onSelect, onHighlight, selectedStyle, highlightedStyle, showArrowButtons, continuous, mode} = config
this.type = 'scrubber'
this._addLiveProperty('items', items)
this._addLiveProperty('selectedStyle', selectedStyle || null)
this._addLiveProperty('overlayStyle', highlightedStyle || null)
this._addLiveProperty('showArrowButtons', showArrowButtons || false)
this._addLiveProperty('mode', mode || 'free')
this._addLiveProperty('continuous', continuous || true)
if (typeof onSelect === 'function' || typeof onHighlight === 'function') {
if (onSelect == null) onSelect = () => {}