react-ace
Advanced tools
Comparing version 1.1.3 to 1.1.4
{ | ||
"name": "react-ace", | ||
"version": "1.1.3", | ||
"version": "1.1.4", | ||
"description": "A react component for Ace Editor", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -50,2 +50,6 @@ #React-Ace | ||
|showGutter| boolean| | ||
|showPrintMargin| boolean| | ||
|highlightActiveLine| boolean| | ||
|readOnly| boolean| | ||
|maxLines| Maximum number of lines to be displayed| | ||
|value | String value you want to populate in the code highlighter| | ||
@@ -52,0 +56,0 @@ |onLoad| Function onLoad | |
@@ -48,3 +48,7 @@ /** @jsx React.DOM */ | ||
value: React.PropTypes.string, | ||
onLoad: React.PropTypes.func | ||
onLoad: React.PropTypes.func, | ||
maxLines : React.PropTypes.number, | ||
readOnly : React.PropTypes.bool, | ||
highlightActiveLine : React.PropTypes.bool, | ||
showPrintMargin : React.PropTypes.bool | ||
}, | ||
@@ -58,7 +62,11 @@ getDefaultProps: function() { | ||
width : '500px', | ||
fontSize : 12, | ||
value: '', | ||
value : '', | ||
fontSize : 12, | ||
showGutter : true, | ||
onChange : null, | ||
onLoad : null | ||
onChange : null, | ||
onLoad : null, | ||
maxLines : null, | ||
readOnly : false, | ||
highlightActiveLine : true, | ||
showPrintMargin : true | ||
}; | ||
@@ -81,2 +89,7 @@ }, | ||
this.editor.renderer.setShowGutter(this.props.showGutter); | ||
this.editor.setOption('maxLines', this.props.maxLines); | ||
this.editor.setOption('readOnly', this.props.readOnly); | ||
this.editor.setOption('highlightActiveLine', this.props.highlightActiveLine); | ||
this.editor.setShowPrintMargin(this.props.setShowPrintMargin); | ||
if (this.props.onLoad) { | ||
@@ -92,2 +105,6 @@ this.props.onLoad(); | ||
this.editor.setFontSize(nextProps.fontSize); | ||
this.editor.setOption('maxLines', nextProps.maxLines); | ||
this.editor.setOption('readOnly', nextProps.readOnly); | ||
this.editor.setOption('highlightActiveLine', nextProps.highlightActiveLine); | ||
this.editor.setShowPrintMargin(nextProps.setShowPrintMargin); | ||
if (this.editor.getValue() !== nextProps.value) { | ||
@@ -94,0 +111,0 @@ this.editor.setValue(nextProps.value); |
13567382
2182
91