From 362f696e3e89008c362da2d7c885dbad57ad61fb Mon Sep 17 00:00:00 2001 From: Corey Johnson Date: Mon, 9 Jun 2014 13:43:59 -0700 Subject: [PATCH] Add setFontFamily and setFontSize to ReactEditorView --- src/editor-component.coffee | 6 +++--- src/react-editor-view.coffee | 6 ++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/editor-component.coffee b/src/editor-component.coffee index 4461ae6da..38a5903c2 100644 --- a/src/editor-component.coffee +++ b/src/editor-component.coffee @@ -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}) diff --git a/src/react-editor-view.coffee b/src/react-editor-view.coffee index 12abb2190..5eb953105 100644 --- a/src/react-editor-view.coffee +++ b/src/react-editor-view.coffee @@ -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'