Files
atom/src/cursor-component.coffee
Nathan Sobo 65b1e13b83 Use Atom-specific fork of React allowing selection restoration opt out
This fork of React allows data-react-skip-selection-restoration to be
defined on input elements, skipping costly selection restoration that
occurs when the input element is focused during reconciliation.
2014-05-20 23:05:13 -06:00

16 lines
451 B
CoffeeScript

React = require 'react-atom-fork'
{div} = require 'reactionary-atom-fork'
module.exports =
CursorComponent = React.createClass
displayName: 'CursorComponent'
render: ->
{cursor, scrollTop, scrollLeft} = @props
{top, left, height, width} = cursor.getPixelRect()
top -= scrollTop
left -= scrollLeft
WebkitTransform = "translate3d(#{left}px, #{top}px, 0px)"
div className: 'cursor', style: {height, width, WebkitTransform}