Only add a block in the flyout if it is not disabled (#1204)

* Only add a block in the flyout if it is not disabled

* PR feedback

* remove previous fix
This commit is contained in:
Sam El-Husseini
2017-06-30 14:51:18 -07:00
committed by Rachel Fenichel
parent de67108b17
commit 21b05d2a69

View File

@@ -605,11 +605,13 @@ Blockly.Gesture.prototype.doFieldClick_ = function() {
Blockly.Gesture.prototype.doBlockClick_ = function() {
// Block click in an autoclosing flyout.
if (this.flyout_ && this.flyout_.autoClose) {
if (!Blockly.Events.getGroup()) {
Blockly.Events.setGroup(true);
if (!this.targetBlock_.disabled) {
if (!Blockly.Events.getGroup()) {
Blockly.Events.setGroup(true);
}
var newBlock = this.flyout_.createBlock(this.targetBlock_);
newBlock.scheduleSnapAndBump();
}
var newBlock = this.flyout_.createBlock(this.targetBlock_);
newBlock.scheduleSnapAndBump();
} else {
// Clicks events are on the start block, even if it was a shadow.
Blockly.Events.fire(