mirror of
https://github.com/google/blockly.git
synced 2026-01-10 02:17:09 +01:00
Fix connection compatibility rules. Use the previous connection when 'pasting above' a block that already has a previous block.
This commit is contained in:
@@ -147,7 +147,16 @@ blocklyApp.WorkspaceTreeComponent = ng.core
|
||||
pasteToConnection_: function(connection) {
|
||||
var that = this;
|
||||
this.treeService.runWhilePreservingFocus(function() {
|
||||
that.clipboardService.pasteFromClipboard(connection);
|
||||
// If the connection is a 'previousConnection' and that connection is
|
||||
// already joined to something, use the 'nextConnection' of the
|
||||
// previous block instead in order to do an insertion.
|
||||
if (connection.type == Blockly.PREVIOUS_STATEMENT &&
|
||||
connection.isConnected()) {
|
||||
that.clipboardService.pasteFromClipboard(
|
||||
connection.targetConnection);
|
||||
} else {
|
||||
that.clipboardService.pasteFromClipboard(connection);
|
||||
}
|
||||
}, this.tree.id);
|
||||
},
|
||||
sendToMarkedSpot_: function() {
|
||||
|
||||
Reference in New Issue
Block a user