mirror of
https://github.com/google/blockly.git
synced 2026-01-10 02:17:09 +01:00
Disable/enable function calls along with their definitions (#2019)
Fixes #1344 Extends the event listener on procedure caller blocks to also check for their definition being enabled/disabled and update their own state in response.
This commit is contained in:
@@ -669,7 +669,14 @@ Blockly.BlockSvg.prototype.showContextMenu_ = function(e) {
|
||||
Blockly.Msg['ENABLE_BLOCK'] : Blockly.Msg['DISABLE_BLOCK'],
|
||||
enabled: !this.getInheritedDisabled(),
|
||||
callback: function() {
|
||||
var group = Blockly.Events.getGroup();
|
||||
if (!group) {
|
||||
Blockly.Events.setGroup(true);
|
||||
}
|
||||
block.setDisabled(!block.disabled);
|
||||
if (!group) {
|
||||
Blockly.Events.setGroup(false);
|
||||
}
|
||||
}
|
||||
};
|
||||
menuOptions.push(disableOption);
|
||||
|
||||
Reference in New Issue
Block a user