From 2e0e4e69bba270c05ea793442546312eed47e95c Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 14 Mar 2017 14:02:48 -0700 Subject: [PATCH] Drop on prefix from property names --- docs/api/touch-bar-scrubber.md | 14 +++++++------- lib/browser/api/touch-bar.js | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/docs/api/touch-bar-scrubber.md b/docs/api/touch-bar-scrubber.md index 98ded37eb2da..f203d6a63571 100644 --- a/docs/api/touch-bar-scrubber.md +++ b/docs/api/touch-bar-scrubber.md @@ -1,16 +1,16 @@ ## Class: TouchBarScrubber -> Create a scrubber (a scrollablbe selector) +> Create a scrubber (a scrollable selector) Process: [Main](../tutorial/quick-start.md#main-process) ### `new TouchBarScrubber(options)` * `options` Object - * `items` [ScrubberItem[]](structures/scrubber-item.md) - An array of items to place in this scruber - * `onSelect` Function - Called when the user taps an item that was not the last tapped item + * `items` [ScrubberItem[]](structures/scrubber-item.md) - An array of items to place in this scrubber + * `select` Function - Called when the user taps an item that was not the last tapped item * `selectedIndex` - The index of the item the user selected - * `onHightlight` Function - Called when the user taps any item + * `highlight` Function - Called when the user taps any item * `highlightedIndex` - The index of the item the user touched ### Instance Properties @@ -33,7 +33,7 @@ updates the control in the touch bar. Possible values: #### `touchBarSegmentedControl.overlayStyle` -A `String` retpresenting the style that selected items in the scrubber should have. This style is overlayed on top +A `String` representing the style that selected items in the scrubber should have. This style is overlayed on top of the scrubber item instead of being placed behind it Updating this value immediately updates the control in the touch bar. Possible values: @@ -56,5 +56,5 @@ updates the control in the touch bar. Possible values: #### `touchBarSegmentedControl.continuous` -A `Boolean` representing whether this scrubber is continous or not. Updating this value immediately -updates the control in the touch bar. \ No newline at end of file +A `Boolean` representing whether this scrubber is continuous or not. Updating this value immediately +updates the control in the touch bar. diff --git a/lib/browser/api/touch-bar.js b/lib/browser/api/touch-bar.js index 22e758074d20..4ddbde5b1592 100644 --- a/lib/browser/api/touch-bar.js +++ b/lib/browser/api/touch-bar.js @@ -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) } } }