|
|
@ -42,7 +42,8 @@ class Editor extends React.Component {
|
|
|
|
super(props)
|
|
|
|
super(props)
|
|
|
|
this.state = {
|
|
|
|
this.state = {
|
|
|
|
...DEFAULT_SETTINGS,
|
|
|
|
...DEFAULT_SETTINGS,
|
|
|
|
preset: DEFAULT_PRESET_ID
|
|
|
|
preset: DEFAULT_PRESET_ID,
|
|
|
|
|
|
|
|
loading: true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
this.export = this.export.bind(this)
|
|
|
|
this.export = this.export.bind(this)
|
|
|
@ -80,7 +81,8 @@ class Editor extends React.Component {
|
|
|
|
// Load from localStorage
|
|
|
|
// Load from localStorage
|
|
|
|
...getSettings(localStorage),
|
|
|
|
...getSettings(localStorage),
|
|
|
|
// and then URL params
|
|
|
|
// and then URL params
|
|
|
|
...initialState
|
|
|
|
...initialState,
|
|
|
|
|
|
|
|
loading: false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Makes sure the slash in 'application/X' is decoded
|
|
|
|
// Makes sure the slash in 'application/X' is decoded
|
|
|
@ -334,12 +336,13 @@ class Editor extends React.Component {
|
|
|
|
{/*key ensures Carbon's internal language state is updated when it's changed by Dropdown*/}
|
|
|
|
{/*key ensures Carbon's internal language state is updated when it's changed by Dropdown*/}
|
|
|
|
<Carbon
|
|
|
|
<Carbon
|
|
|
|
key={language}
|
|
|
|
key={language}
|
|
|
|
|
|
|
|
ref={this.carbonNode}
|
|
|
|
config={this.state}
|
|
|
|
config={this.state}
|
|
|
|
onChange={this.updateCode}
|
|
|
|
onChange={this.updateCode}
|
|
|
|
onAspectRatioChange={this.updateAspectRatio}
|
|
|
|
onAspectRatioChange={this.updateAspectRatio}
|
|
|
|
titleBar={titleBar}
|
|
|
|
titleBar={titleBar}
|
|
|
|
updateTitleBar={this.updateTitleBar}
|
|
|
|
updateTitleBar={this.updateTitleBar}
|
|
|
|
ref={this.carbonNode}
|
|
|
|
loading={this.state.loading}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
{code != null ? code : DEFAULT_CODE}
|
|
|
|
{code != null ? code : DEFAULT_CODE}
|
|
|
|
</Carbon>
|
|
|
|
</Carbon>
|
|
|
|