From 8ef9be2fdfa27d090ccc4876310a30884fdce14f Mon Sep 17 00:00:00 2001 From: alschmiedt Date: Mon, 1 Jul 2019 10:38:28 -0700 Subject: [PATCH] Fixes theme error for headless workspaces --- core/workspace.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/workspace.js b/core/workspace.js index 6b662fc16..54b6a260b 100644 --- a/core/workspace.js +++ b/core/workspace.js @@ -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); + } }; /**