juttle-react-ace
Advanced tools
Comparing version 3.1.0 to 3.1.2
@@ -42,2 +42,4 @@ 'use strict'; | ||
value: function componentDidMount() { | ||
var _this2 = this; | ||
var _props = this.props; | ||
@@ -61,2 +63,3 @@ var name = _props.name; | ||
var onLoad = _props.onLoad; | ||
var commands = _props.commands; | ||
@@ -92,2 +95,8 @@ this.editor = _brace2['default'].edit(name); | ||
if (Array.isArray(commands)) { | ||
commands.forEach(function (command) { | ||
_this2.editor.commands.addCommand(command); | ||
}); | ||
} | ||
if (keyboardHandler) { | ||
@@ -236,3 +245,4 @@ this.editor.setKeyboardHandler('ace/keyboard/' + keyboardHandler); | ||
keyboardHandler: _react.PropTypes.string, | ||
wrapEnabled: _react.PropTypes.bool | ||
wrapEnabled: _react.PropTypes.bool, | ||
commands: _react.PropTypes.array | ||
}; | ||
@@ -239,0 +249,0 @@ |
{ | ||
"name": "juttle-react-ace", | ||
"version": "3.1.0", | ||
"version": "3.1.2", | ||
"description": "A react component for Ace Editor", | ||
@@ -5,0 +5,0 @@ "main": "lib/ace.js", |
@@ -72,2 +72,3 @@ # React-Ace | ||
|keyboardHandler| String corresponding to the keybinding mode to set (such as vim)| | ||
|commands| Array of new commands to add to the editor | ||
@@ -74,0 +75,0 @@ |
@@ -38,2 +38,3 @@ import ace from 'brace'; | ||
onLoad, | ||
commands, | ||
} = this.props; | ||
@@ -70,2 +71,8 @@ | ||
if (Array.isArray(commands)) { | ||
commands.forEach((command) => { | ||
this.editor.commands.addCommand(command); | ||
}); | ||
} | ||
if (keyboardHandler) { | ||
@@ -200,2 +207,3 @@ this.editor.setKeyboardHandler('ace/keyboard/' + keyboardHandler); | ||
wrapEnabled: PropTypes.bool, | ||
commands: PropTypes.array, | ||
}; | ||
@@ -202,0 +210,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
1834704
36135
114