Skip to content

Commit

Permalink
Merge pull request #1 from tmickel/merge-fixes
Browse files Browse the repository at this point in the history
Merge fixes
  • Loading branch information
rachel-fenichel committed May 13, 2016
2 parents 9073cec + 5fbc7f4 commit 702308f
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 80 deletions.
5 changes: 4 additions & 1 deletion core/field_iconmenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand Down
2 changes: 1 addition & 1 deletion core/flyout.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.';
Expand Down
4 changes: 2 additions & 2 deletions core/workspace_svg.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.';
}
Expand All @@ -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.';
}
Expand Down
Binary file removed demos/mirror/icon.png
Binary file not shown.
76 changes: 0 additions & 76 deletions demos/mirror/index.html

This file was deleted.

0 comments on commit 702308f

Please sign in to comment.