Fixes theme error for headless workspaces

This commit is contained in:
alschmiedt
2019-07-01 10:38:28 -07:00
parent a45b0b1d85
commit 8ef9be2fdf

View File

@@ -31,6 +31,7 @@ goog.require('Blockly.utils');
goog.require('Blockly.utils.math');
goog.require('Blockly.VariableMap');
goog.require('Blockly.WorkspaceComment');
goog.require('Blockly.Themes.Classic');
/**
@@ -113,6 +114,12 @@ Blockly.Workspace = function(opt_options) {
* @private
*/
this.potentialVariableMap_ = null;
// Set the default theme. This is for headless workspaces. This will get
// overwritten by the theme passed into the inject call for rendered workspaces.
if (!Blockly.getTheme()) {
Blockly.setTheme(Blockly.Themes.Classic);
}
};
/**