Fix grouping of disconnect and delete.

This commit is contained in:
Neil Fraser 2016-04-03 15:45:19 -07:00
parent 2ce0a25f92
commit 960b07daab
2 changed files with 4 additions and 0 deletions

View file

@ -726,7 +726,9 @@ Blockly.BlockSvg.prototype.showContextMenu_ = function(e) {
Blockly.Msg.DELETE_X_BLOCKS.replace('%1', String(descendantCount)),
enabled: true,
callback: function() {
Blockly.Events.setGroup(true);
block.dispose(true, true);
Blockly.Events.setGroup(false);
}
};
menuOptions.push(deleteOption);

View file

@ -268,6 +268,7 @@ Blockly.onKeyDown_ = function(e) {
}
if (deleteBlock) {
// Common code for delete and cut.
Blockly.Events.setGroup(true);
Blockly.hideChaff();
var heal = Blockly.dragMode_ != Blockly.DRAG_FREE;
Blockly.selected.dispose(heal, true);
@ -275,6 +276,7 @@ Blockly.onKeyDown_ = function(e) {
Blockly.highlightedConnection_.unhighlight();
Blockly.highlightedConnection_ = null;
}
Blockly.Events.setGroup(false);
}
};