This commit is contained in:
Neil Fraser
2016-11-18 20:26:56 -08:00
parent 531b6caf5d
commit fbd9276e9c
3 changed files with 9 additions and 8 deletions

View File

@@ -443,8 +443,8 @@ Blockly.Blocks['procedures_mutatorarg'] = {
*/
createNewVar_: function(newText) {
var source = this.sourceBlock_;
if (source && source.workspace && source.workspace.options
&& source.workspace.options.parentWorkspace) {
if (source && source.workspace && source.workspace.options &&
source.workspace.options.parentWorkspace) {
source.workspace.options.parentWorkspace.createVariable(newText);
}
}
@@ -861,13 +861,13 @@ Blockly.Blocks['procedures_ifreturn'] = {
if (block.type == 'procedures_defnoreturn' && this.hasReturnValue_) {
this.removeInput('VALUE');
this.appendDummyInput('VALUE')
.appendField(Blockly.Msg.PROCEDURES_DEFRETURN_RETURN);
.appendField(Blockly.Msg.PROCEDURES_DEFRETURN_RETURN);
this.hasReturnValue_ = false;
} else if (block.type == 'procedures_defreturn' &&
!this.hasReturnValue_) {
this.removeInput('VALUE');
this.appendValueInput('VALUE')
.appendField(Blockly.Msg.PROCEDURES_DEFRETURN_RETURN);
.appendField(Blockly.Msg.PROCEDURES_DEFRETURN_RETURN);
this.hasReturnValue_ = true;
}
this.setWarningText(null);

View File

@@ -61,7 +61,7 @@ Blockly.FieldDropdown = function(menuGenerator, opt_validator) {
goog.inherits(Blockly.FieldDropdown, Blockly.Field);
/**
* Horizontal distance that a checkmark ovehangs the dropdown.
* Horizontal distance that a checkmark overhangs the dropdown.
*/
Blockly.FieldDropdown.CHECKMARK_OVERHANG = 25;
@@ -90,7 +90,7 @@ Blockly.FieldDropdown.prototype.value_ = '';
Blockly.FieldDropdown.prototype.imageElement_ = null;
/**
* Object wih src, height, width, and alt attributes if currently selected
* Object with src, height, width, and alt attributes if currently selected
* option is an image, or null.
* @type {Object}
* @private

View File

@@ -385,8 +385,9 @@ WorkspaceFactoryInit.addWorkspaceFactoryEventListeners_ = function(controller) {
var isInvalidBlockPlacement = function(block) {
return ((controller.isUserGenShadowBlock(block.id) &&
!block.getSurroundParent()) ||
(!controller.isUserGenShadowBlock(block.id) && block.getSurroundParent()
&& controller.isUserGenShadowBlock(block.getSurroundParent().id)));
(!controller.isUserGenShadowBlock(block.id) &&
block.getSurroundParent() &&
controller.isUserGenShadowBlock(block.getSurroundParent().id)));
};
// Add change listeners for toolbox workspace in workspace factory.