diff --git a/core/block_render_svg.js b/core/block_render_svg.js index ebe6012bd..6987b45d6 100644 --- a/core/block_render_svg.js +++ b/core/block_render_svg.js @@ -317,10 +317,6 @@ Blockly.BlockSvg.prototype.getHeightWidth = function() { * If true, also render block's parent, grandparent, etc. Defaults to true. */ Blockly.BlockSvg.prototype.render = function(opt_bubble) { - if (!this.workspace) { - // This block is being deleted so don't try to render it. - return; - } Blockly.Field.startCache(); this.rendered = true; diff --git a/core/connection.js b/core/connection.js index 082cfc441..bfde24cff 100644 --- a/core/connection.js +++ b/core/connection.js @@ -444,10 +444,6 @@ Blockly.Connection.prototype.connect = function(otherConnection) { return; } this.checkConnection_(otherConnection); - var eventGroup = Blockly.Events.getGroup(); - if (!eventGroup) { - Blockly.Events.setGroup(true); - } // Determine which block is superior (higher in the source stack). if (this.isSuperior()) { // Superior block. @@ -456,9 +452,6 @@ Blockly.Connection.prototype.connect = function(otherConnection) { // Inferior block. otherConnection.connect_(this); } - if (!eventGroup) { - Blockly.Events.setGroup(false); - } }; /** @@ -548,16 +541,8 @@ Blockly.Connection.prototype.disconnect = function() { childBlock = this.sourceBlock_; parentConnection = otherConnection; } - - var eventGroup = Blockly.Events.getGroup(); - if (!eventGroup) { - Blockly.Events.setGroup(true); - } this.disconnectInternal_(parentBlock, childBlock); parentConnection.respawnShadow_(); - if (!eventGroup) { - Blockly.Events.setGroup(false); - } }; /** diff --git a/core/rendered_connection.js b/core/rendered_connection.js index 6dba66123..b9ab29a16 100644 --- a/core/rendered_connection.js +++ b/core/rendered_connection.js @@ -226,7 +226,6 @@ Blockly.RenderedConnection.prototype.highlight = function() { * attached to this connection. This happens when a block is expanded. * Also unhides down-stream comments. * @return {!Array.} List of blocks to render. - * @protected */ Blockly.RenderedConnection.prototype.unhideAll = function() { this.setHidden(false); @@ -274,7 +273,6 @@ Blockly.RenderedConnection.prototype.unhighlight = function() { /** * Set whether this connections is hidden (not tracked in a database) or not. * @param {boolean} hidden True if connection is hidden. - * @protected */ Blockly.RenderedConnection.prototype.setHidden = function(hidden) { this.hidden_ = hidden; @@ -289,7 +287,6 @@ Blockly.RenderedConnection.prototype.setHidden = function(hidden) { * Hide this connection, as well as all down-stream connections on any block * attached to this connection. This happens when a block is collapsed. * Also hides down-stream comments. - * @protected */ Blockly.RenderedConnection.prototype.hideAll = function() { this.setHidden(true); @@ -328,49 +325,6 @@ Blockly.RenderedConnection.prototype.isConnectionAllowed = function(candidate, candidate); }; -/** - * Connect this connection to another connection. - * @param {!Blockly.Connection} otherConnection Connection to connect to. - * @override - */ -Blockly.RenderedConnection.prototype.connect = function(otherConnection) { - Blockly.RenderedConnection.superClass_.connect.call(this, otherConnection); - - // This is a quick check to make sure we aren't doing unecessary work. - if (this.hidden_ || otherConnection.hidden_) { - var superiorConnection = this.isSuperior() ? this : otherConnection; - if (superiorConnection.hidden_) { - superiorConnection.hideAll(); - } else { - superiorConnection.unhideAll(); - } - - var renderedBlock = superiorConnection.targetBlock(); - var display = superiorConnection.hidden_ ? 'none' : 'block'; - renderedBlock.getSvgRoot().style.display = display; - renderedBlock.rendered = !superiorConnection.hidden_; - } -}; - -/** - * Disconnect this connection. - * @override - */ -Blockly.RenderedConnection.prototype.disconnect = function() { - var superiorConnection = this.isSuperior() ? this : this.targetConnection; - if (this.targetConnection && superiorConnection.hidden_) { - superiorConnection.unhideAll(); - var renderedBlock = superiorConnection.targetBlock(); - renderedBlock.getSvgRoot().style.display = 'block'; - renderedBlock.rendered = true; - - // Set the hidden state for the connection back to true so shadow blocks - // will be hidden. - superiorConnection.setHidden(true); - } - Blockly.RenderedConnection.superClass_.disconnect.call(this); -}; - /** * Disconnect two blocks that are connected by this connection. * @param {!Blockly.Block} parentBlock The superior block. @@ -408,7 +362,7 @@ Blockly.RenderedConnection.prototype.respawnShadow_ = function() { } blockShadow.initSvg(); blockShadow.render(false); - if (parentBlock.rendered && !this.hidden_) { + if (parentBlock.rendered) { parentBlock.render(); } } diff --git a/tests/mocha/connection_test.js b/tests/mocha/connection_test.js index 8dd57ac95..ef3714228 100644 --- a/tests/mocha/connection_test.js +++ b/tests/mocha/connection_test.js @@ -2,7 +2,7 @@ suite('Connections', function() { - suite('Rendered', function() { + suite.skip('Rendered', function() { function assertAllConnectionsHiddenState(block, hidden) { var connections = block.getConnections_(true); for (var i = 0; i < connections.length; i++) {