adding support to 'line numbers' settings (#116)

* adding support to 'line numbers' settings

* Update Settings.js
main
Neto Guimarães 7 years ago committed by Michael Fix
parent 0303b48928
commit e51628ce8d

@ -72,7 +72,7 @@ class Carbon extends React.Component {
const config = { ...DEFAULT_SETTINGS, ...this.props.config } const config = { ...DEFAULT_SETTINGS, ...this.props.config }
const options = { const options = {
lineNumbers: false, lineNumbers: config.lineNumbers,
mode: this.state.language || 'plaintext', mode: this.state.language || 'plaintext',
theme: config.theme, theme: config.theme,
scrollBarStyle: null, scrollBarStyle: null,

@ -51,6 +51,11 @@ class Settings extends React.Component {
enabled={this.props.enabled.widthAdjustment} enabled={this.props.enabled.widthAdjustment}
onChange={this.props.onChange.bind(null, 'widthAdjustment')} onChange={this.props.onChange.bind(null, 'widthAdjustment')}
/> />
<Toggle
label="Line Numbers"
enabled={this.props.enabled.lineNumbers}
onChange={this.props.onChange.bind(null, 'lineNumbers')}
/>
<Slider <Slider
label="Padding (vertical)" label="Padding (vertical)"
initialValue={16} initialValue={16}

@ -49,6 +49,7 @@ class Editor extends React.Component {
dropShadow: true, dropShadow: true,
windowControls: true, windowControls: true,
widthAdjustment: true, widthAdjustment: true,
lineNumbers: false,
paddingVertical: '48px', paddingVertical: '48px',
paddingHorizontal: '32px', paddingHorizontal: '32px',
uploading: false, uploading: false,

Loading…
Cancel
Save