Minor cleanup

This commit is contained in:
Rachel Fenichel
2018-11-19 12:44:43 -08:00
parent 53d8ac8b0b
commit 991b70410e
3 changed files with 13 additions and 5 deletions

View File

@@ -162,9 +162,9 @@ Blockly.BlockDragger.prototype.startBlockDrag = function(currentDragDeltaXY,
this.draggingBlock_.bringToFront();
}
// // During a drag there may be a lot of rerenders, but not field changes.
// // Turn the cache on so we don't do spurious remeasures during the drag.
// Blockly.Field.startCache();
// During a drag there may be a lot of rerenders, but not field changes.
// Turn the cache on so we don't do spurious remeasures during the drag.
Blockly.Field.startCache();
this.workspace_.setResizesEnabled(false);
Blockly.BlockAnimations.disconnectUiStop();

View File

@@ -391,8 +391,6 @@ Blockly.BlockSvg.prototype.renderFields_ = function(fieldList,
root.setAttribute('display', 'none');
}
}
return this.RTL ? -cursorX : cursorX;
};

View File

@@ -431,6 +431,16 @@ Blockly.Connection.prototype.isConnectionAllowed = function(candidate) {
break;
}
case Blockly.NEXT_STATEMENT: {
// Don't let a block with no next connection bump other blocks out of the
// stack. But covering up a shadow block or stack of shadow blocks is
// fine. Similarly, replacing a terminal statement with another terminal
// statement is allowed.
if (candidate.isConnected() &&
!this.sourceBlock_.nextConnection &&
!candidate.targetBlock().isShadow() &&
candidate.targetBlock().nextConnection) {
return false;
}
break;
}
default: