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

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

View file

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

View file

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

View file

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