Add 'editor' class to ReactEditorView wrapper for backward compatibility

This commit is contained in:
Nathan Sobo
2014-04-10 13:44:20 -06:00
parent c862ccbc56
commit 495b1571ca
2 changed files with 5 additions and 5 deletions

View File

@@ -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

View File

@@ -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: ->