From e9f46aea286dd19a73c72c9ebfd33435cc90ce09 Mon Sep 17 00:00:00 2001 From: alschmiedt Date: Tue, 29 Sep 2020 18:04:41 -0700 Subject: [PATCH] Fix adding an icon in xml definition (#4336) --- core/toolbox/category.js | 21 +++++++++++---------- core/toolbox/collapsible_category.js | 5 +++-- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/core/toolbox/category.js b/core/toolbox/category.js index 03691db73..cd77da7fe 100644 --- a/core/toolbox/category.js +++ b/core/toolbox/category.js @@ -123,11 +123,12 @@ Blockly.utils.object.inherits(Blockly.ToolboxCategory, Blockly.ToolboxItem); * @typedef {{ * container:?string, * row:?string, + * rowcontentcontainer:?string, * icon:?string, * label:?string, * selected:?string, - * openIcon:?string, - * closedIcon:?string + * openicon:?string, + * closedicon:?string * }} */ Blockly.ToolboxCategory.CssConfig; @@ -167,13 +168,13 @@ Blockly.ToolboxCategory.prototype.makeDefaultCssConfig_ = function() { return { 'container': 'blocklyToolboxCategory', 'row': 'blocklyTreeRow', - 'rowContentContainer': 'blocklyTreeRowContentContainer', + 'rowcontentcontainer': 'blocklyTreeRowContentContainer', 'icon': 'blocklyTreeIcon', 'label': 'blocklyTreeLabel', 'contents': 'blocklyToolboxContents', 'selected': 'blocklyTreeSelected', - 'openIcon': 'blocklyTreeIconOpen', - 'closedIcon': 'blocklyTreeIconClosed', + 'openicon': 'blocklyTreeIconOpen', + 'closedicon': 'blocklyTreeIconClosed', }; }; @@ -278,7 +279,7 @@ Blockly.ToolboxCategory.prototype.createRowContainer_ = function() { */ Blockly.ToolboxCategory.prototype.createRowContentsContainer_ = function() { var contentsContainer = document.createElement('div'); - Blockly.utils.dom.addClass(contentsContainer, this.cssConfig_['rowContentContainer']); + Blockly.utils.dom.addClass(contentsContainer, this.cssConfig_['rowcontentcontainer']); return contentsContainer; }; @@ -422,8 +423,8 @@ Blockly.ToolboxCategory.prototype.openIcon_ = function(iconDiv) { if (!iconDiv) { return; } - Blockly.utils.dom.removeClasses(iconDiv, this.cssConfig_['closedIcon']); - Blockly.utils.dom.addClass(iconDiv, this.cssConfig_['openIcon']); + Blockly.utils.dom.removeClasses(iconDiv, this.cssConfig_['closedicon']); + Blockly.utils.dom.addClass(iconDiv, this.cssConfig_['openicon']); }; /** @@ -435,8 +436,8 @@ Blockly.ToolboxCategory.prototype.closeIcon_ = function(iconDiv) { if (!iconDiv) { return; } - Blockly.utils.dom.removeClasses(iconDiv, this.cssConfig_['openIcon']); - Blockly.utils.dom.addClass(iconDiv, this.cssConfig_['closedIcon']); + Blockly.utils.dom.removeClasses(iconDiv, this.cssConfig_['openicon']); + Blockly.utils.dom.addClass(iconDiv, this.cssConfig_['closedicon']); }; /** diff --git a/core/toolbox/collapsible_category.js b/core/toolbox/collapsible_category.js index b4e2af3c1..6621d4731 100644 --- a/core/toolbox/collapsible_category.js +++ b/core/toolbox/collapsible_category.js @@ -71,11 +71,12 @@ Blockly.utils.object.inherits(Blockly.CollapsibleToolboxCategory, Blockly.Toolbo * @typedef {{ * container:?string, * row:?string, + * rowcontentcontainer:?string, * icon:?string, * label:?string, * selected:?string, - * openIcon:?string, - * closedIcon:?string, + * openicon:?string, + * closedicon:?string, * contents:?string * }} */