|
|
|
@ -72,6 +72,7 @@ class Editor extends React.Component {
|
|
|
|
|
this.save = this.save.bind(this)
|
|
|
|
|
this.upload = this.upload.bind(this)
|
|
|
|
|
this.updateCode = this.updateCode.bind(this)
|
|
|
|
|
this.updateTitleBar = this.updateTitleBar.bind(this)
|
|
|
|
|
this.updateAspectRatio = this.updateAspectRatio.bind(this)
|
|
|
|
|
this.resetDefaultSettings = this.resetDefaultSettings.bind(this)
|
|
|
|
|
}
|
|
|
|
@ -120,6 +121,10 @@ class Editor extends React.Component {
|
|
|
|
|
this.setState({ aspectRatio })
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
updateTitleBar(titleBar) {
|
|
|
|
|
this.setState({ titleBar })
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
save() {
|
|
|
|
|
this.getCarbonImage().then(dataUrl => {
|
|
|
|
|
const link = document.createElement('a')
|
|
|
|
@ -216,6 +221,7 @@ class Editor extends React.Component {
|
|
|
|
|
config={this.state}
|
|
|
|
|
updateCode={code => this.updateCode(code)}
|
|
|
|
|
onAspectRatioChange={this.updateAspectRatio}
|
|
|
|
|
updateTitleBar={this.updateTitleBar}
|
|
|
|
|
>
|
|
|
|
|
{this.state.code || DEFAULT_CODE}
|
|
|
|
|
</Carbon>
|
|
|
|
|