Blockly.parseToolboxTree_ -> Blockly.Options.parseToolboxTree

This commit is contained in:
rachel-fenichel 2016-04-07 13:38:36 -07:00
parent bfdfd0ba02
commit 576830c309
2 changed files with 5 additions and 5 deletions

View file

@ -45,7 +45,7 @@ Blockly.Options = function(options) {
var hasDisable = false;
var hasSounds = false;
} else {
var languageTree = Blockly.Options.parseToolboxTree_(options['toolbox']);
var languageTree = Blockly.Options.parseToolboxTree(options['toolbox']);
var hasCategories = Boolean(languageTree &&
languageTree.getElementsByTagName('category').length);
var hasTrashcan = options['trashcan'];
@ -192,9 +192,8 @@ Blockly.Options.parseGridOptions_ = function(options) {
* Parse the provided toolbox tree into a consistent DOM format.
* @param {Node|string} tree DOM tree of blocks, or text representation of same.
* @return {Node} DOM tree of blocks, or null.
* @private
*/
Blockly.Options.parseToolboxTree_ = function(tree) {
Blockly.Options.parseToolboxTree = function(tree) {
if (tree) {
if (typeof tree != 'string') {
if (typeof XSLTProcessor == 'undefined' && tree.outerHTML) {

View file

@ -29,6 +29,7 @@ goog.provide('Blockly.WorkspaceSvg');
// TODO(scr): Fix circular dependencies
// goog.require('Blockly.Block');
goog.require('Blockly.ConnectionDB');
goog.require('Blockly.Options');
goog.require('Blockly.ScrollbarPair');
goog.require('Blockly.Trashcan');
goog.require('Blockly.Workspace');
@ -937,7 +938,7 @@ Blockly.WorkspaceSvg.prototype.playAudio = function(name, opt_volume) {
* @param {Node|string} tree DOM tree of blocks, or text representation of same.
*/
Blockly.WorkspaceSvg.prototype.updateToolbox = function(tree) {
tree = Blockly.parseToolboxTree_(tree);
tree = Blockly.Options.parseToolboxTree(tree);
if (!tree) {
if (this.options.languageTree) {
throw 'Can\'t nullify an existing toolbox.';