[WIP] Squash bugs in code merged to blockly core

This commit is contained in:
Evan W. Patton
2016-10-04 13:54:43 -04:00
parent 79bde8c552
commit 5174a4da12
6 changed files with 19 additions and 23 deletions

View File

@@ -467,9 +467,9 @@ Blockly.Block.prototype.setParent = function(newParent) {
children.splice(x, 1);
break;
}
if (descendant.errorIcon) {
var data = descendant.errorIcon.getIconLocation();
data.bubble = descendant.errorIcon;
if (child.errorIcon) {
var data = child.errorIcon.getIconLocation();
data.bubble = child.errorIcon;
this.draggedBubbles_.push(data);
}
}

View File

@@ -848,13 +848,11 @@ Blockly.BlockSvg.prototype.renderDrawRight_ = function(steps, highlightSteps,
}
// Create external input connection.
if (row.subtype == Blockly.INDENTED_VALUE) {
connectionX = connectionsXY.x +
(this.RTL ? -inputRows.statementEdge - 1: inputRows.statementEdge + 9 + input.fieldWidth);
connectionY = connectionsXY.y + cursorY-8;
connectionX = (this.RTL ? -inputRows.statementEdge - 1: inputRows.statementEdge + 9 + input.fieldWidth);
connectionY = cursorY-8;
} else {
connectionX = connectionsXY.x +
(this.RTL ? -inputRows.rightEdge - 1: inputRows.rightEdge + 1);
connectionY = connectionsXY.y + cursorY;
connectionX = (this.RTL ? -inputRows.rightEdge - 1: inputRows.rightEdge + 1);
connectionY = cursorY;
}
input.connection.setOffsetInBlock(connectionX, cursorY);
if (input.connection.isConnected()) {

View File

@@ -131,9 +131,9 @@ Blockly.Mutator.prototype.createEditor_ = function() {
};
this.workspace_ = new Blockly.WorkspaceSvg(workspaceOptions);
this.workspace_.isMutator = true;
this.flyout_ = new Blockly.Flyout();
this.flyout_.autoClose = false;
this.svgDialog_.appendChild(this.flyout_.createDom());
//this.flyout_ = new Blockly.Flyout();
//this.flyout_.autoClose = false;
//this.svgDialog_.appendChild(this.flyout_.createDom());
this.svgDialog_.appendChild(
this.workspace_.createDom('blocklyMutatorBackground'));

View File

@@ -56,7 +56,6 @@ Blockly.Options = function(options) {
if (hasCollapse === undefined) {
hasCollapse = hasCategories;
}
var configForTypeBlock = options['typeblock_config'];
var hasComments = options['comments'];
if (hasComments === undefined) {
hasComments = hasCategories;
@@ -97,7 +96,6 @@ Blockly.Options = function(options) {
if (hasScrollbars === undefined) {
hasScrollbars = hasCategories;
}
var configForTypeBlock = null;
}
var hasCss = options['css'];
if (hasCss === undefined) {
@@ -125,10 +123,14 @@ Blockly.Options = function(options) {
this.hasCss = hasCss;
this.horizontalLayout = horizontalLayout;
this.languageTree = languageTree;
this.configForTypeBlock = configForTypeBlock;
this.gridOptions = Blockly.Options.parseGridOptions_(options);
this.zoomOptions = Blockly.Options.parseZoomOptions_(options);
this.toolboxPosition = toolboxPosition;
// AppInventor configuration
this.configForTypeBlock = options['configForTypeBlock'] !== undefined ? options['configForTypeBlock'] : null;
this.hasBackpack = !!options['backpack'];
this.enableWarningIndicator = !!options['warningIndicator'];
};
/**

View File

@@ -131,10 +131,6 @@ Blockly.Workspace.prototype.addTopBlock = function(block) {
}
}
}
if (this.warningIndicator) {
this.warningIndicator.dispose();
this.warningIndicator = null;
}
};
/**

View File

@@ -998,7 +998,7 @@ Blockly.WorkspaceSvg.prototype.showContextMenu_ = function(e) {
Blockly.workspace_arranged_latest_position= Blockly.BLKS_HORIZONTAL;
arrangeBlocks(Blockly.BLKS_HORIZONTAL);
};
options.push(arrangeOptionH);
menuOptions.push(arrangeOptionH);
// Arrange blocks in column order.
var arrangeOptionV = {enabled: (Blockly.workspace_arranged_position !== Blockly.BLKS_VERTICAL)};
@@ -1008,7 +1008,7 @@ Blockly.WorkspaceSvg.prototype.showContextMenu_ = function(e) {
Blockly.workspace_arranged_latest_position = Blockly.BLKS_VERTICAL;
arrangeBlocks(Blockly.BLKS_VERTICAL);
};
options.push(arrangeOptionV);
menuOptions.push(arrangeOptionV);
/**
* Function that returns a name to be used to sort blocks.
@@ -1109,7 +1109,7 @@ Blockly.WorkspaceSvg.prototype.showContextMenu_ = function(e) {
Blockly.workspace_arranged_type = Blockly.BLKS_CATEGORY;
rearrangeWorkspace();
};
options.push(sortOptionCat);
menuOptions.push(sortOptionCat);
// Called after a sort or collapse/expand to redisplay blocks.
function rearrangeWorkspace() {
@@ -1124,7 +1124,7 @@ Blockly.WorkspaceSvg.prototype.showContextMenu_ = function(e) {
var helpOption = {enabled: false};
helpOption.text = Blockly.Msg.HELP;
helpOption.callback = function() {};
options.push(helpOption);
menuOptions.push(helpOption);
Blockly.ContextMenu.show(e, menuOptions, this.RTL);
};