Rename Selection(s)Component to Highlight(s)Component

This commit is contained in:
Ben Ogle
2014-06-13 16:52:49 -07:00
parent 002e14990b
commit 084632a985
5 changed files with 11 additions and 11 deletions

View File

@@ -232,7 +232,7 @@ describe "EditorComponent", ->
editor.setText("a\0b")
expect(editor.pixelPositionForScreenPosition([0, Infinity]).left).toEqual 2 * charWidth
fdescribe "gutter rendering", ->
describe "gutter rendering", ->
[gutter] = []
lineNumberHasClass = (screenRow, klass) ->

View File

@@ -2,8 +2,8 @@ React = require 'react-atom-fork'
{div} = require 'reactionary-atom-fork'
module.exports =
SelectionComponent = React.createClass
displayName: 'SelectionComponent'
HighlightComponent = React.createClass
displayName: 'HighlightComponent'
render: ->
{editor, screenRange, lineHeightInPixels} = @props

View File

@@ -1,21 +1,21 @@
React = require 'react-atom-fork'
{div} = require 'reactionary-atom-fork'
{isEqualForProperties} = require 'underscore-plus'
SelectionComponent = require './selection-component'
HighlightComponent = require './highlight-component'
module.exports =
SelectionsComponent = React.createClass
displayName: 'SelectionsComponent'
HighlightsComponent = React.createClass
displayName: 'HighlightsComponent'
render: ->
div className: 'selections', @renderSelections()
div className: 'highlights', @renderSelections()
renderSelections: ->
{editor, selectionScreenRanges, lineHeightInPixels} = @props
selectionComponents = []
for selectionId, screenRange of selectionScreenRanges
selectionComponents.push(SelectionComponent({key: selectionId, screenRange, editor, lineHeightInPixels}))
selectionComponents.push(HighlightComponent({key: selectionId, screenRange, editor, lineHeightInPixels}))
selectionComponents
componentWillMount: ->

View File

@@ -3,7 +3,7 @@ React = require 'react-atom-fork'
{debounce, isEqual, isEqualForProperties, multiplyString, toArray} = require 'underscore-plus'
{$$} = require 'space-pen'
SelectionsComponent = require './selections-component'
HighlightsComponent = require './highlights-component'
DummyLineNode = $$(-> @div className: 'line', style: 'position: absolute; visibility: hidden;', => @span 'x')[0]
AcceptFilter = {acceptNode: -> NodeFilter.FILTER_ACCEPT}
@@ -22,7 +22,7 @@ LinesComponent = React.createClass
WebkitTransform: "translate3d(#{-scrollLeft}px, #{-scrollTop}px, 0px)"
div {className: 'lines editor-colors', style},
SelectionsComponent({editor, selectionScreenRanges, lineHeightInPixels, defaultCharWidth}) if @isMounted()
HighlightsComponent({editor, selectionScreenRanges, lineHeightInPixels, defaultCharWidth}) if @isMounted()
componentWillMount: ->
@measuredLines = new WeakSet

View File

@@ -36,7 +36,7 @@ class ReactEditorView extends View
node = @component.getDOMNode()
@scrollView = $(node).find('.scroll-view')
@underlayer = $(node).find('.selections').addClass('underlayer')
@underlayer = $(node).find('.highlights').addClass('underlayer')
@overlayer = $(node).find('.lines').addClass('overlayer')
@hiddenInput = $(node).find('.hidden-input')