Drop on prefix from property names
authorKevin Sawicki <kevinsawicki@gmail.com>
Tue, 14 Mar 2017 21:02:48 +0000 (14:02 -0700)
committerKevin Sawicki <kevinsawicki@gmail.com>
Tue, 14 Mar 2017 21:02:48 +0000 (14:02 -0700)
docs/api/touch-bar-scrubber.md
lib/browser/api/touch-bar.js

index 98ded37..f203d6a 100644 (file)
@@ -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.
index 22e7580..4ddbde5 100644 (file)
@@ -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)
         }
       }
     }