File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -403,9 +403,10 @@ Blockly.ScratchBlocks.ProcedureUtils.buildShadowDom_ = function(type) {
403403 var fieldValue = '' ;
404404 break
405405 case 'b' :
406- var shadowType = 'checkbox' ;
407- var fieldName = 'CHECKBOX' ;
408- var fieldValue = 'FALSE' ;
406+ var checkboxDisabled = Blockly . Procedures . ADDON_SP_CHECKBOXES_DISABLED ;
407+ var shadowType = checkboxDisabled ? 'text' : 'checkbox' ;
408+ var fieldName = checkboxDisabled ? 'TEXT' : 'CHECKBOX' ;
409+ var fieldValue = checkboxDisabled ? '' : 'FALSE' ;
409410 break
410411 }
411412 shadowDom . setAttribute ( 'type' , shadowType ) ;
@@ -424,7 +425,9 @@ Blockly.ScratchBlocks.ProcedureUtils.buildShadowDom_ = function(type) {
424425 * @this Blockly.Block
425426 */
426427Blockly . ScratchBlocks . ProcedureUtils . attachShadow_ = function ( input , argumentType ) {
427- if ( [ 'n' , 's' , 'b' ] . includes ( argumentType ) ) {
428+ var validArgs = [ 'n' , 's' ] ;
429+ if ( ! Blockly . Procedures . ADDON_SP_CHECKBOXES_DISABLED ) validArgs . push ( 'b' ) ;
430+ if ( validArgs . includes ( argumentType ) ) {
428431 var blockType = { 'n' : 'math_number' , 's' : 'text' , 'b' : 'checkbox' } [ argumentType ] ;
429432 Blockly . Events . disable ( ) ;
430433 try {
You can’t perform that action at this time.
0 commit comments