fix(find-in-thread): minor rename fixes

This commit is contained in:
Evan Morikawa 2016-03-02 15:00:01 -08:00
parent 800f3a041b
commit 9a576015ed
3 changed files with 8 additions and 9 deletions

View file

@ -61,7 +61,9 @@ export default class FindInThread extends React.Component {
return ""
}
_navEnabled() { return this.state.resultsLength > 0 }
_navEnabled() {
return this.state.resultsLength > 0;
}
_onPrevResult = () => {
if (this._navEnabled()) { Actions.previousSearchResult() }

View file

@ -31,7 +31,7 @@ class Scrollbar extends React.Component
componentDidMount: ->
if @props.scrollbarTickProvider?.listen
@_tickUnsub = @props.scrollbarTickProvider.listen(@_onTickProvider)
@_tickUnsub = @props.scrollbarTickProvider.listen(@_onTickProviderChange)
shouldComponentUpdate: (nextProps, nextState) =>
not Utils.isEqualReact(nextProps, @props) or
@ -69,7 +69,7 @@ class Scrollbar extends React.Component
@props.getScrollRegion()._recomputeDimensions(options)
@_recomputeDimensions(options)
_onTickProvider: =>
_onTickProviderChange: =>
if not @props.scrollbarTickProvider?.scrollbarTicks
throw new Error("The scrollbarTickProvider must implement `scrollbarTicks`")
@setState scrollbarTicks: @props.scrollbarTickProvider.scrollbarTicks()

View file

@ -23,15 +23,12 @@ class SearchableComponentStore extends NylasStore {
this.listenTo(Actions.previousSearchResult, this._previousSearchResult)
}
/**
* The searchIndex
*/
getCurrentRegionIndex(regionId) {
let searchIndex = null;
let regionOffset = null;
if (regionId && this.currentMatch && this.currentMatch.node.getAttribute('data-region-id') === regionId) {
searchIndex = +this.currentMatch.node.getAttribute('data-render-index')
regionOffset = +this.currentMatch.node.getAttribute('data-render-index')
}
return searchIndex
return regionOffset
}
getCurrentSearchData() {