mirror of
https://github.com/atom/atom.git
synced 2026-01-22 21:38:10 -05:00
21 lines
527 B
CoffeeScript
21 lines
527 B
CoffeeScript
React = require 'react'
|
|
{div} = require 'reactionary'
|
|
SubscriberMixin = require './subscriber-mixin'
|
|
|
|
module.exports =
|
|
CursorComponent = React.createClass
|
|
mixins: [SubscriberMixin]
|
|
|
|
render: ->
|
|
{top, left, height, width} = @props.cursor.getPixelRect()
|
|
className = 'cursor'
|
|
className += ' blink-off' if @props.blinkOff
|
|
|
|
div className: className, style: {top, left, height, width}
|
|
|
|
componentDidMount: ->
|
|
@subscribe @props.cursor, 'moved', => @forceUpdate()
|
|
|
|
componentWillUnmount: ->
|
|
@unsubscribe()
|