react-ace
Advanced tools
Comparing version 2.6.0 to 2.7.0
@@ -10,3 +10,2 @@ 'use strict'; | ||
propTypes: { | ||
mode: React.PropTypes.string, | ||
@@ -35,3 +34,4 @@ theme: React.PropTypes.string, | ||
editorProps: React.PropTypes.object, | ||
keyboardHandler: React.PropTypes.string | ||
keyboardHandler: React.PropTypes.string, | ||
wrapEnabled: React.PropTypes.bool | ||
}, | ||
@@ -57,3 +57,4 @@ getDefaultProps: function getDefaultProps() { | ||
cursorStart: 1, | ||
editorProps: {} | ||
editorProps: {}, | ||
wrapEnabled: false | ||
}; | ||
@@ -103,2 +104,3 @@ }, | ||
this.editor.renderer.setShowGutter(this.props.showGutter); | ||
this.editor.getSession().setUseWrapMode(this.props.wrapEnabled); | ||
this.editor.setOption('maxLines', this.props.maxLines); | ||
@@ -129,3 +131,2 @@ this.editor.setOption('readOnly', this.props.readOnly); | ||
componentWillReceiveProps: function componentWillReceiveProps(nextProps) { | ||
this.editor = ace.edit(nextProps.name); | ||
this.editor.getSession().setMode('ace/mode/' + nextProps.mode); | ||
@@ -146,5 +147,2 @@ this.editor.setTheme('ace/theme/' + nextProps.theme); | ||
this.editor.renderer.setShowGutter(nextProps.showGutter); | ||
if (nextProps.onLoad) { | ||
nextProps.onLoad(this.editor); | ||
} | ||
}, | ||
@@ -151,0 +149,0 @@ |
{ | ||
"name": "react-ace", | ||
"version": "2.6.0", | ||
"version": "2.7.0", | ||
"description": "A react component for Ace Editor", | ||
@@ -5,0 +5,0 @@ "main": "lib/ace.js", |
@@ -8,3 +8,2 @@ var ace = require('brace'); | ||
propTypes: { | ||
mode: React.PropTypes.string, | ||
@@ -33,3 +32,4 @@ theme: React.PropTypes.string, | ||
editorProps: React.PropTypes.object, | ||
keyboardHandler: React.PropTypes.string | ||
keyboardHandler: React.PropTypes.string, | ||
wrapEnabled: React.PropTypes.bool | ||
}, | ||
@@ -55,3 +55,4 @@ getDefaultProps: function() { | ||
cursorStart: 1, | ||
editorProps: {} | ||
editorProps: {}, | ||
wrapEnabled:false | ||
}; | ||
@@ -101,2 +102,3 @@ }, | ||
this.editor.renderer.setShowGutter(this.props.showGutter); | ||
this.editor.getSession().setUseWrapMode(this.props.wrapEnabled); | ||
this.editor.setOption('maxLines', this.props.maxLines); | ||
@@ -112,3 +114,3 @@ this.editor.setOption('readOnly', this.props.readOnly); | ||
this.editor.on('change', this.onChange); | ||
if (this.props.keyboardHandler) { | ||
@@ -128,3 +130,2 @@ this.editor.setKeyboardHandler('ace/keyboard/' + this.props.keyboardHandler); | ||
componentWillReceiveProps: function(nextProps) { | ||
this.editor = ace.edit(nextProps.name); | ||
this.editor.getSession().setMode('ace/mode/' + nextProps.mode); | ||
@@ -145,5 +146,2 @@ this.editor.setTheme('ace/theme/' + nextProps.theme); | ||
this.editor.renderer.setShowGutter(nextProps.showGutter); | ||
if (nextProps.onLoad) { | ||
nextProps.onLoad(this.editor); | ||
} | ||
}, | ||
@@ -150,0 +148,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
3003547
13
69867