Skip to content
Snippets Groups Projects
Commit 33397c00 authored by Ray Schamp's avatar Ray Schamp
Browse files

Move rest of workspace/vm setup to VMManager

parent 2d5d8d26
No related branches found
No related tags found
No related merge requests found
......@@ -22,7 +22,6 @@ class GUI extends React.Component {
}
onReceiveWorkspace (workspace) {
this.workspace = workspace;
this.workspace.addChangeListener(this.props.vm.blockListener);
VMManager.attachWorkspace(this.props.vm, this.workspace);
VMManager.attachMouseEvents(this.props.vm, this.stage);
VMManager.attachKeyboardEvents(this.props.vm);
......
......@@ -2,6 +2,7 @@ const ScratchBlocks = require('scratch-blocks');
module.exports = {
attachWorkspace: function (vm, workspace) {
workspace.addChangeListener(vm.blockListener);
vm.on('STACK_GLOW_ON', data => workspace.glowStack(data.id, true));
vm.on('STACK_GLOW_OFF', data => workspace.glowStack(data.id, false));
vm.on('BLOCK_GLOW_ON', data => workspace.glowBlock(data.id, true));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment