Skip to content

Commit 939e412

Browse files
authored
this error build makes no sense]
1 parent 7a39106 commit 939e412

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

blocks_vertical/live_tests.js

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,27 @@ goog.require('Blockly.Blocks');
66
goog.require('Blockly.Colours');
77
goog.require('Blockly.ScratchBlocks.VerticalExtensions');
88

9+
const mutatorPopulateUtil2 = function (connection, type, optValue, optValueName) {
10+
if (connection.sourceBlock_.isInsertionMarker_) return;
11+
12+
ScratchBlocks.Events.disable();
13+
const block = this.workspace.newBlock(type);
14+
try {
15+
if (optValue) block.setFieldValue(optValue, optValueName);
16+
block.setShadow(true);
17+
if (!this.isInsertionMarker()) {
18+
block.initSvg();
19+
block.render(false);
20+
}
21+
} finally {
22+
ScratchBlocks.Events.enable();
23+
}
24+
25+
if (ScratchBlocks.Events.isEnabled()) ScratchBlocks.Events.fire(new ScratchBlocks.Events.BlockCreate(block));
26+
if (block.outputConnection) block.outputConnection.connect(connection);
27+
else block.previousConnection.connect(connection);
28+
}
29+
930
Blockly.Blocks['control_expandableIf'] = {
1031
/**
1132
* pm: Block for joining strings together (determined by user)
@@ -38,7 +59,7 @@ Blockly.Blocks['control_expandableIf'] = {
3859
this.endsInElse = false;
3960
},
4061

41-
fillInBlock: mutatorPopulateUtil,
62+
fillInBlock: mutatorPopulateUtil2,
4263
fixupButtons: function () {
4364
const expandableInput = this.getInput("");
4465
this.inputList.splice(this.inputList.indexOf(expandableInput), 1);

0 commit comments

Comments
 (0)