Skip to content

Commit ec63814

Browse files
authored
procedures.js -- fix define coloring (2/2)
1 parent 63c64f4 commit ec63814

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

blocks_vertical/procedures.js

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -979,15 +979,15 @@ Blockly.ScratchBlocks.ProcedureUtils.argumentReporterMutationToDom = function()
979979

980980
Blockly.ScratchBlocks.ProcedureUtils.argumentReporterDomToMutation = function(dom) {
981981
try {
982-
this.color = JSON.parse(dom.getAttribute('color'))
983-
this.updateDisplay_()
982+
this.color = JSON.parse(dom.getAttribute('color'));
983+
this.updateDisplay_();
984984
} catch (err) {
985985
console.warn('unknown old argument reporter')
986986
}
987987
};
988988

989989
Blockly.ScratchBlocks.ProcedureUtils.argumentReporterUpdateDisplay = function(dom) {
990-
this.setColour(...this.color)
990+
this.setColour(...this.color);
991991
};
992992

993993
Blockly.Blocks['procedures_definition'] = {
@@ -1129,11 +1129,16 @@ Blockly.Blocks['procedures_declaration'] = {
11291129
this.argumentDefaults_ = [];
11301130
this.warp_ = false;
11311131
this.output_ = false;
1132-
this.isDisplayOnly = true
1133-
this.edited = false
1134-
this.outputType = 'statement'
1135-
this.image = ''
1136-
this.color = [Blockly.Colours.more.primary, Blockly.Colours.more.secondary, Blockly.Colours.more.tertiary]
1132+
this.isDisplayOnly = true;
1133+
this.edited = false;
1134+
this.outputType = 'statement';
1135+
this.image = '';
1136+
this.color = [Blockly.Colours.more.primary, Blockly.Colours.more.secondary, Blockly.Colours.more.tertiary];
1137+
1138+
queueMicrotask(() => {
1139+
this.setColour(...this.color);
1140+
this.parentBlock_.setColour(...this.color);console.log(this.color);
1141+
});
11371142
},
11381143
// Shared.
11391144
getProcCode: Blockly.ScratchBlocks.ProcedureUtils.getProcCode,

0 commit comments

Comments
 (0)