Skip to content

Commit 5f95b1d

Browse files
Merge branch 'develop' into develop-builds
2 parents dc0f5bd + 4c28ad2 commit 5f95b1d

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

core/block_svg.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,10 @@ Blockly.BlockSvg.prototype.setCollapsed = function(collapsed) {
576576
if (this.collapsed_ == collapsed) {
577577
return;
578578
}
579+
// Disable collapsing for procedures definition.
580+
if (this.type === 'procedures_definition') {
581+
return;
582+
}
579583
var renderList = [this];
580584
// Show/hide the inputs.
581585
for (var i = 0, input; input = this.inputList[i]; i++) {

core/contextmenu.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,11 +259,14 @@ Blockly.ContextMenu.blockCollapseOption = function(block) {
259259
descendantCount -= nextBlock.getDescendants(false, true).length;
260260
}
261261

262+
// Disable collapsing for procedures definition.
263+
const enabled = block.type !== Blockly.PROCEDURES_DEFINITION_BLOCK_TYPE;
264+
262265
if (block.isCollapsed()) {
263266
var expandOption = {
264267
text: descendantCount == 1 ? Blockly.Msg.EXPAND_BLOCK :
265268
Blockly.Msg.EXPAND_X_BLOCKS.replace('%1', String(descendantCount)),
266-
enabled: true,
269+
enabled,
267270
callback: function() {
268271
block.setCollapsed(false);
269272
// uncollapse any blocks in branches
@@ -277,7 +280,7 @@ Blockly.ContextMenu.blockCollapseOption = function(block) {
277280
var collapseOption = {
278281
text: descendantCount == 1 ? Blockly.Msg.COLLAPSE_BLOCK :
279282
Blockly.Msg.COLLAPSE_X_BLOCKS.replace('%1', String(descendantCount)),
280-
enabled: true,
283+
enabled,
281284
callback: function() {
282285
block.setCollapsed(true);
283286
}

0 commit comments

Comments
 (0)