diff --git a/core/field_iconmenu.js b/core/field_iconmenu.js index f991a6236c..76d2e10987 100644 --- a/core/field_iconmenu.js +++ b/core/field_iconmenu.js @@ -121,7 +121,10 @@ Blockly.FieldIconMenu.prototype.setValue = function(newValue) { * @private */ Blockly.FieldIconMenu.prototype.setParentFieldImage = function(src) { - if (this.sourceBlock_) { + // Only attempt if we have a set sourceBlock_ and parentBlock_ + // It's possible that this function could be called before + // a parent block is set; in that case, fail silently. + if (this.sourceBlock_ && this.sourceBlock_.parentBlock_) { var parentBlock = this.sourceBlock_.parentBlock_; // Loop through all inputs' fields to find the first FieldImage for (var i = 0, input; input = parentBlock.inputList[i]; i++) { diff --git a/core/flyout.js b/core/flyout.js index 4971ddbefd..300d863eaf 100644 --- a/core/flyout.js +++ b/core/flyout.js @@ -1036,7 +1036,7 @@ Blockly.Flyout.prototype.placeNewBlock_ = function(originBlock, workspace) { // Create the new block by cloning the block in the flyout (via XML). var xml = Blockly.Xml.blockToDom(originBlock); - var block = Blockly.Xml.domToBlock(workspace, xml); + var block = Blockly.Xml.domToBlock(xml, workspace); var blockSvgNew = block.getSvgRoot(); if (!blockSvgNew) { throw 'block is not rendered.'; diff --git a/core/workspace_svg.js b/core/workspace_svg.js index dd4af4a397..b90c629bfe 100644 --- a/core/workspace_svg.js +++ b/core/workspace_svg.js @@ -478,7 +478,7 @@ Blockly.WorkspaceSvg.prototype.highlightBlock = function(id) { Blockly.WorkspaceSvg.prototype.glowBlock = function(id, isGlowingBlock) { var block = null; if (id) { - block = Blockly.Block.getById(id); + block = this.getBlockById(id); if (!block) { throw 'Tried to glow block that does not exist.'; } @@ -494,7 +494,7 @@ Blockly.WorkspaceSvg.prototype.glowBlock = function(id, isGlowingBlock) { Blockly.WorkspaceSvg.prototype.glowStack = function(id, isGlowingStack) { var block = null; if (id) { - block = Blockly.Block.getById(id); + block = this.getBlockById(id); if (!block) { throw 'Tried to glow stack on block that does not exist.'; } diff --git a/demos/mirror/icon.png b/demos/mirror/icon.png deleted file mode 100644 index 45e2a9a290..0000000000 Binary files a/demos/mirror/icon.png and /dev/null differ diff --git a/demos/mirror/index.html b/demos/mirror/index.html deleted file mode 100644 index 8721d7354b..0000000000 --- a/demos/mirror/index.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - - Blockly Demo: Mirrored Blockly - - - - - - -

Blockly > - Demos > Mirrored Blockly

- -

This is a simple demo of a master Blockly that controls a slave Blockly. - Open the JavaScript console to see the event passing.

- -

→ More info on events

- - - - - - -
-
-
-
-
- - - - - - -