mirror of
https://github.com/atom/atom.git
synced 2026-01-23 22:08:08 -05:00
20 lines
537 B
CoffeeScript
20 lines
537 B
CoffeeScript
{React, div} = require 'reactionary'
|
|
SubscriberMixin = require './subscriber-mixin'
|
|
CursorComponent = require './cursor-component'
|
|
|
|
module.exports =
|
|
SelectionComponent = React.createClass
|
|
mixins: [SubscriberMixin]
|
|
|
|
render: ->
|
|
{selection, lineHeight, charWidth} = @props
|
|
{cursor} = selection
|
|
div className: 'selection',
|
|
CursorComponent({cursor, lineHeight, charWidth})
|
|
|
|
componentDidMount: ->
|
|
@subscribe @props.selection, 'screen-range-changed', => @forceUpdate()
|
|
|
|
componentWillUnmount: ->
|
|
@unsubscribe()
|