[Issue-796] adding undefined check before trying to position category… (#858)

* [Issue-796] adding undefined check before trying to position category tree as it doesn't exist in the no category variant

* [Issue-796] moving call to position toolbox into earlier existing if/else that already accounts for if its a category variant
This commit is contained in:
MichaelZawadzki 2017-04-07 14:12:37 -04:00 committed by Ray Schamp
parent a357585e25
commit 995cc0e8d6

View file

@ -1475,6 +1475,7 @@ Blockly.WorkspaceSvg.prototype.updateToolbox = function(tree) {
}
this.options.languageTree = tree;
this.toolbox_.populate_(tree);
this.toolbox_.position();
} else {
if (!this.flyout_) {
throw 'Existing toolbox has categories. Can\'t change mode.';
@ -1482,7 +1483,6 @@ Blockly.WorkspaceSvg.prototype.updateToolbox = function(tree) {
this.options.languageTree = tree;
this.flyout_.show(tree.childNodes);
}
this.toolbox_.position();
};
/**