mirror of
https://github.com/google/blockly.git
synced 2026-03-08 22:30:09 +01:00
When a block is pasted to a tree, set the active descendant of that tree to the newly-pasted block.
This commit is contained in:
@@ -115,6 +115,7 @@ blocklyApp.ClipboardService = ng.core
|
||||
alert(
|
||||
Blockly.Msg.PASTED_BLOCK_FROM_CLIPBOARD_MSG +
|
||||
reconstitutedBlock.toString());
|
||||
return reconstitutedBlock.id;
|
||||
},
|
||||
pasteToMarkedConnection: function(block) {
|
||||
var xml = Blockly.Xml.blockToDom(block);
|
||||
|
||||
@@ -157,13 +157,18 @@ blocklyApp.WorkspaceTreeComponent = ng.core
|
||||
// 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.
|
||||
var newBlockId = null;
|
||||
|
||||
if (connection.type == Blockly.PREVIOUS_STATEMENT &&
|
||||
connection.isConnected()) {
|
||||
that.clipboardService.pasteFromClipboard(
|
||||
newBlockId = that.clipboardService.pasteFromClipboard(
|
||||
connection.targetConnection);
|
||||
} else {
|
||||
that.clipboardService.pasteFromClipboard(connection);
|
||||
newBlockId = that.clipboardService.pasteFromClipboard(connection);
|
||||
}
|
||||
|
||||
// Move the screenreader focus to the newly-pasted block.
|
||||
that.treeService.setActiveDesc(newBlockId + 'blockRoot', that.tree.id);
|
||||
}, this.tree.id);
|
||||
},
|
||||
moveToMarkedSpot_: function() {
|
||||
|
||||
Reference in New Issue
Block a user