mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-14 02:06:29 +00:00
add ModalBase, LaunchModal & install Reflux
This commit is contained in:
@@ -13,16 +13,24 @@ var CodeViewer = React.createClass({
|
||||
editor.$blockScrolling = Infinity
|
||||
editor.renderer.setShowGutter(false)
|
||||
editor.setReadOnly(true)
|
||||
editor.setTheme('ace/theme/xcode')
|
||||
editor.setHighlightActiveLine(false)
|
||||
|
||||
var session = editor.getSession()
|
||||
session.setMode('ace/mode/' + this.props.mode)
|
||||
session.setUseSoftTabs(true)
|
||||
session.setOption('useWorker', false)
|
||||
|
||||
this.setState({editor: editor})
|
||||
},
|
||||
componentDidUpdate: function () {
|
||||
this.state.editor.setValue(this.props.code)
|
||||
this.state.editor.getSession().setMode('ace/mode/' + this.props.mode)
|
||||
componentDidUpdate: function (prevProps) {
|
||||
if (this.state.editor.getValue() !== this.props.code) {
|
||||
this.state.editor.setValue(this.props.code)
|
||||
this.state.editor.clearSelection()
|
||||
}
|
||||
if (prevProps.mode !== this.props.mode) {
|
||||
this.state.editor.getSession().setMode('ace/mode/' + this.props.mode)
|
||||
}
|
||||
},
|
||||
render: function () {
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user