minor changes
This commit is contained in:
@@ -33,11 +33,11 @@ class BlocklyWindow extends Component {
|
||||
componentDidUpdate(props) {
|
||||
const workspace = Blockly.getMainWorkspace();
|
||||
var initialXML = this.props.initialXml
|
||||
if(props.initialXml !== initialXml){
|
||||
if (props.initialXml !== initialXml) {
|
||||
// guarantees that the current xml-code (this.props.initialXml) is rendered
|
||||
workspace.clear();
|
||||
if(!initialXML) initialXML = initialXml;
|
||||
Blockly.Xml.domToWorkspace(Blockly.Xml.textToDom(initialXML), workspace) ;
|
||||
if (!initialXML) initialXML = initialXml;
|
||||
Blockly.Xml.domToWorkspace(Blockly.Xml.textToDom(initialXML), workspace);
|
||||
}
|
||||
Blockly.svgResize(workspace);
|
||||
}
|
||||
@@ -48,11 +48,11 @@ class BlocklyWindow extends Component {
|
||||
style={this.props.blocklyCSS}
|
||||
readOnly={this.props.readOnly !== undefined ? this.props.readOnly : false}
|
||||
trashcan={this.props.trashcan !== undefined ? this.props.trashcan : true}
|
||||
renderer='zelos'
|
||||
renderer='geras'
|
||||
zoom={{ // https://developers.google.com/blockly/guides/configure/web/zoom
|
||||
controls: this.props.zoomControls !== undefined ? this.props.zoomControls : true,
|
||||
wheel: false,
|
||||
startScale: 0.8,
|
||||
startScale: 1.0,
|
||||
maxScale: 3,
|
||||
minScale: 0.3,
|
||||
scaleSpeed: 1.2
|
||||
@@ -63,14 +63,14 @@ class BlocklyWindow extends Component {
|
||||
length: 1,
|
||||
colour: '#4EAF47', // senseBox-green
|
||||
snap: false
|
||||
}}
|
||||
}}
|
||||
media={'/media/'}
|
||||
move={this.props.move !== undefined && !this.props.move ? {} :
|
||||
{ // https://developers.google.com/blockly/guides/configure/web/move
|
||||
scrollbars: true,
|
||||
drag: true,
|
||||
wheel: false
|
||||
}}
|
||||
}}
|
||||
initialXml={this.props.initialXml ? this.props.initialXml : initialXml}
|
||||
>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user