diff --git a/core/block.js b/core/block.js index ae34618c0..fc239b052 100644 --- a/core/block.js +++ b/core/block.js @@ -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); } } diff --git a/core/block_render_svg.js b/core/block_render_svg.js index 4a528b803..5a10a3292 100644 --- a/core/block_render_svg.js +++ b/core/block_render_svg.js @@ -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()) { diff --git a/core/mutator.js b/core/mutator.js index 4bd98392b..852f49b41 100644 --- a/core/mutator.js +++ b/core/mutator.js @@ -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')); diff --git a/core/options.js b/core/options.js index 0a1a2715e..dc1f78e39 100644 --- a/core/options.js +++ b/core/options.js @@ -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']; }; /** diff --git a/core/workspace.js b/core/workspace.js index 0936f77bb..deac51b6f 100644 --- a/core/workspace.js +++ b/core/workspace.js @@ -131,10 +131,6 @@ Blockly.Workspace.prototype.addTopBlock = function(block) { } } } - if (this.warningIndicator) { - this.warningIndicator.dispose(); - this.warningIndicator = null; - } }; /** diff --git a/core/workspace_svg.js b/core/workspace_svg.js index 0deb2cf0f..9cfdea64f 100644 --- a/core/workspace_svg.js +++ b/core/workspace_svg.js @@ -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); };