mirror of
https://github.com/scratchfoundation/scratch-blocks.git
synced 2025-08-28 22:10:31 -04:00
Blockly.parseToolboxTree_ -> Blockly.Options.parseToolboxTree
This commit is contained in:
parent
bfdfd0ba02
commit
576830c309
2 changed files with 5 additions and 5 deletions
|
@ -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) {
|
||||
|
|
|
@ -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.';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue