mirror of
https://github.com/google/blockly.git
synced 2026-01-10 02:17:09 +01:00
Implement correct behaviour for copying a block from the toolbox to a marked spot.
This commit is contained in:
@@ -176,15 +176,18 @@ blocklyApp.WorkspaceTreeComponent = ng.core
|
||||
var blockDescription = this.block.toString();
|
||||
|
||||
var newBlockId = this.clipboardService.pasteToMarkedConnection(
|
||||
this.block, false);
|
||||
this.block);
|
||||
|
||||
var that = this;
|
||||
this.removeBlockAndSetFocus_(this.block, function() {
|
||||
that.block.dispose(true);
|
||||
});
|
||||
|
||||
// Invoke a digest cycle, so that the DOM settles.
|
||||
setTimeout(function() {
|
||||
var destinationTreeId = that.treeService.getTreeIdForBlock(newBlockId);
|
||||
that.treeService.clearActiveDesc(destinationTreeId);
|
||||
|
||||
document.getElementById(destinationTreeId).focus();
|
||||
that.treeService.setActiveDesc(
|
||||
newBlockId + 'blockRoot', destinationTreeId);
|
||||
|
||||
Reference in New Issue
Block a user