Address PR comments

This commit is contained in:
alschmiedt
2021-07-19 13:40:05 -07:00
parent fe9273ad5c
commit 268a83d054
2 changed files with 4 additions and 5 deletions

View File

@@ -17,7 +17,7 @@
goog.module('Blockly.utils.toolbox');
goog.module.declareLegacyNamespace();
const {IE} = goog.require('Blockly.utils.userAgent');
const userAgent = goog.require('Blockly.utils.userAgent');
const {textToDom} = goog.require('Blockly.Xml');
const {CssConfig: CategoryCssConfig} = goog.requireType('Blockly.ToolboxCategory');
@@ -273,7 +273,7 @@ const hasCategories = function(toolboxJson) {
return false;
}
let toolboxKind = toolboxJson['kind'];
const toolboxKind = toolboxJson['kind'];
if (toolboxKind) {
return toolboxKind == CATEGORY_TOOLBOX_KIND;
}
@@ -387,7 +387,7 @@ const addAttributes = function(node, obj) {
const parseToolboxTree = function(toolboxDef) {
if (toolboxDef) {
if (typeof toolboxDef != 'string') {
if (IE && toolboxDef.outerHTML) {
if (userAgent.IE && toolboxDef.outerHTML) {
// In this case the tree will not have been properly built by the
// browser. The HTML will be contained in the element, but it will
// not have the proper DOM structure since the browser doesn't support
@@ -430,4 +430,4 @@ exports = {
hasCategories,
isCategoryCollapsible,
parseToolboxTree
}
};

View File

@@ -4,7 +4,6 @@ goog.addDependency('../../blocks/logic.js', ['Blockly.Blocks.logic', 'Blockly.Co
goog.addDependency('../../blocks/loops.js', ['Blockly.Blocks.loops', 'Blockly.Constants.Loops'], ['Blockly', 'Blockly.Blocks', 'Blockly.FieldDropdown', 'Blockly.FieldLabel', 'Blockly.FieldNumber', 'Blockly.FieldVariable', 'Blockly.Warning']);
goog.addDependency('../../blocks/math.js', ['Blockly.Blocks.math', 'Blockly.Constants.Math'], ['Blockly', 'Blockly.Blocks', 'Blockly.FieldDropdown', 'Blockly.FieldLabel', 'Blockly.FieldNumber', 'Blockly.FieldVariable']);
goog.addDependency('../../blocks/procedures.js', ['Blockly.Blocks.procedures'], ['Blockly', 'Blockly.Blocks', 'Blockly.Comment', 'Blockly.FieldCheckbox', 'Blockly.FieldLabel', 'Blockly.FieldTextInput', 'Blockly.Mutator', 'Blockly.Warning'], {'lang': 'es5'});
goog.addDependency('../../blocks/test_blocks.js', ['Blockly.TestBlocks'], ['Blockly', 'Blockly.Blocks'], {'lang': 'es5'});
goog.addDependency('../../blocks/text.js', ['Blockly.Blocks.texts', 'Blockly.Constants.Text'], ['Blockly', 'Blockly.Blocks', 'Blockly.FieldDropdown', 'Blockly.FieldImage', 'Blockly.FieldMultilineInput', 'Blockly.FieldTextInput', 'Blockly.FieldVariable', 'Blockly.Mutator']);
goog.addDependency('../../blocks/variables.js', ['Blockly.Blocks.variables', 'Blockly.Constants.Variables'], ['Blockly', 'Blockly.Blocks', 'Blockly.FieldLabel', 'Blockly.FieldVariable']);
goog.addDependency('../../blocks/variables_dynamic.js', ['Blockly.Constants.VariablesDynamic'], ['Blockly', 'Blockly.Blocks', 'Blockly.FieldLabel', 'Blockly.FieldVariable']);