mirror of
https://github.com/atom/atom.git
synced 2026-01-22 13:28:01 -05:00
Add 'editor' class to ReactEditorView wrapper for backward compatibility
This commit is contained in:
@@ -283,7 +283,7 @@ describe "EditorComponent", ->
|
||||
expect(region1Rect.top).toBe 1 * lineHeightInPixels
|
||||
expect(region1Rect.height).toBe 1 * lineHeightInPixels
|
||||
expect(region1Rect.left).toBe scrollViewClientLeft + 6 * charWidth
|
||||
expect(region1Rect.right).toBe node.clientWidth
|
||||
expect(Math.ceil(region1Rect.right)).toBe node.clientWidth # TODO: Remove ceiling when react-wrapper is removed
|
||||
|
||||
region2Rect = regions[1].getBoundingClientRect()
|
||||
expect(region2Rect.top).toBe 2 * lineHeightInPixels
|
||||
@@ -300,13 +300,13 @@ describe "EditorComponent", ->
|
||||
expect(region1Rect.top).toBe 1 * lineHeightInPixels
|
||||
expect(region1Rect.height).toBe 1 * lineHeightInPixels
|
||||
expect(region1Rect.left).toBe scrollViewClientLeft + 6 * charWidth
|
||||
expect(region1Rect.right).toBe node.clientWidth
|
||||
expect(Math.ceil(region1Rect.right)).toBe node.clientWidth # TODO: Remove ceiling when react-wrapper is removed
|
||||
|
||||
region2Rect = regions[1].getBoundingClientRect()
|
||||
expect(region2Rect.top).toBe 2 * lineHeightInPixels
|
||||
expect(region2Rect.height).toBe 3 * lineHeightInPixels
|
||||
expect(region2Rect.left).toBe scrollViewClientLeft + 0
|
||||
expect(region2Rect.right).toBe node.clientWidth
|
||||
expect(Math.ceil(region2Rect.right)).toBe node.clientWidth # TODO: Remove ceiling when react-wrapper is removed
|
||||
|
||||
region3Rect = regions[2].getBoundingClientRect()
|
||||
expect(region3Rect.top).toBe 5 * lineHeightInPixels
|
||||
|
||||
@@ -4,7 +4,7 @@ EditorComponent = require './editor-component'
|
||||
|
||||
module.exports =
|
||||
class ReactEditorView extends View
|
||||
@content: -> @div class: 'react-wrapper'
|
||||
@content: -> @div class: 'editor react-wrapper'
|
||||
|
||||
constructor: (@editor) ->
|
||||
super
|
||||
@@ -14,7 +14,7 @@ class ReactEditorView extends View
|
||||
afterAttach: (onDom) ->
|
||||
return unless onDom
|
||||
@attached = true
|
||||
@component = React.renderComponent(EditorComponent({@editor}), @element)
|
||||
@component = React.renderComponent(EditorComponent({@editor, parentView: this}), @element)
|
||||
@trigger 'editor:attached', [this]
|
||||
|
||||
beforeDetach: ->
|
||||
|
||||
Reference in New Issue
Block a user