File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff 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 ++ ) {
Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments