adjustment of the tutorial component and all dependencies to the new tutorial.json

This commit is contained in:
Delucse
2020-09-11 10:13:33 +02:00
parent 33445cf67c
commit 6c3709fde8
14 changed files with 368 additions and 324 deletions
+10 -8
View File
@@ -26,16 +26,18 @@ class BlocklyWindow extends Component {
this.props.onChangeWorkspace(event);
Blockly.Events.disableOrphans(event);
});
Blockly.svgResize(workspace);
}
componentDidUpdate(props) {
if(props.initialXml !== this.props.initialXml){
// guarantees that the current xml-code (this.props.initialXml) is rendered
const workspace = Blockly.getMainWorkspace();
workspace.clear();
Blockly.Xml.domToWorkspace(Blockly.Xml.textToDom(this.props.initialXml), workspace);
}
}
// componentDidUpdate(props) {
// const workspace = Blockly.getMainWorkspace();
// if(props.initialXml !== this.props.initialXml){
// // guarantees that the current xml-code (this.props.initialXml) is rendered
// workspace.clear();
// Blockly.Xml.domToWorkspace(Blockly.Xml.textToDom(this.props.initialXml), workspace);
// }
// Blockly.svgResize(workspace);
// }
render() {
return (