Add stack highlighting to playground blocks.

This commit is contained in:
Tim Mickel 2016-06-01 13:54:33 -04:00
parent 1ab391281d
commit 690745aaf0

View file

@ -10,7 +10,7 @@ window.onload = function() {
});
window.workspace = workspace;
// @todo: Also bind to flyout events, block running feedback.
// @todo: Also bind to flyout events.
// Block events.
workspace.addChangeListener(vm.blockListener);
@ -21,6 +21,14 @@ window.onload = function() {
window.hljs.highlightBlock(explorer);
});
// Feedback for stacks running.
vm.runtime.on('STACK_GLOW_ON', function(blockId) {
workspace.glowStack(blockId, true);
});
vm.runtime.on('STACK_GLOW_OFF', function(blockId) {
workspace.glowStack(blockId, false);
});
// Run threads
vm.runtime.start();
};