mirror of
https://github.com/google/blockly.git
synced 2026-01-06 16:40:07 +01:00
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:
@@ -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++) {
|
||||
|
||||
Reference in New Issue
Block a user