Workspace theme (#3093)

* Move the theme object so it's on the workspace.

* Add support for subscribing UI elements to theme component styles and changes.
This commit is contained in:
Sam El-Husseini
2019-09-26 16:52:17 -07:00
committed by GitHub
parent b587ad71c5
commit 870824bc3e
23 changed files with 566 additions and 130 deletions

View File

@@ -90,7 +90,7 @@
function setRandomStyle() {
var blocks = workspace.getAllBlocks();
var styles = Object.keys(Blockly.getTheme().getAllBlockStyles());
var styles = Object.keys(workspace.getTheme().getAllBlockStyles());
styles.splice(styles.indexOf(blocks[0].getStyleName()), 1);
var style = styles[Math.floor(Math.random() * styles.length)];
for(var i = 0, block; block = blocks[i]; i++) {