Add setFontFamily and setFontSize to ReactEditorView

This commit is contained in:
Corey Johnson
2014-06-09 13:43:59 -07:00
parent 677d3abe0e
commit 362f696e3e
2 changed files with 9 additions and 3 deletions

View File

@@ -724,15 +724,15 @@ EditorComponent = React.createClass
setFontSize: (fontSize) ->
@setState({fontSize})
setLineHeight: (lineHeight) ->
@setState({lineHeight})
getFontFamily: ->
@state.fontFamily
setFontFamily: (fontFamily) ->
@setState({fontFamily})
setLineHeight: (lineHeight) ->
@setState({lineHeight})
setShowIndentGuide: (showIndentGuide) ->
@setState({showIndentGuide})

View File

@@ -136,9 +136,15 @@ class ReactEditorView extends View
getFontFamily: ->
@component?.getFontFamily()
setFontFamily: (fontFamily)->
@component?.setFontFamily(fontFamily)
getFontSize: ->
@component?.getFontSize()
setFontSize: (fontSize)->
@component?.setFontSize(fontSize)
setWidthInChars: (widthInChars) ->
@component.getDOMNode().style.width = (@editor.getDefaultCharWidth() * widthInChars) + 'px'