@@ -99,6 +99,7 @@ class BlocklyInterface {
9999 private limitedPointers : any ;
100100 private blockCounts : any ;
101101 private dragJustTerminated : boolean ;
102+ private prevWidth : number ;
102103
103104 constructor ( maxBlocks , subTask ) {
104105 this . subTask = subTask ;
@@ -173,7 +174,7 @@ class BlocklyInterface {
173174
174175 this . options = options ;
175176
176- addExtraBlocks ( this . strings , this . getDefaultColours ( ) ) ;
177+ addExtraBlocks ( this . strings , this . getDefaultColours ( ) , ! this . mainContext . infos || ! this . mainContext . infos . showIfMutator ) ;
177178 this . createSimpleGeneratorsAndBlocks ( ) ;
178179
179180 this . display = display ;
@@ -427,6 +428,24 @@ class BlocklyInterface {
427428 window . jQuery ( "#program" ) . val ( this . programs [ this . codeId ] . javascript ) ;
428429 }
429430
431+ updateSize ( force ) {
432+ let panelWidth = 500 ;
433+ if ( this . languages [ this . codeId ] == "blockly" ) {
434+ panelWidth = window . jQuery ( "#blocklyDiv" ) . width ( ) - 10 ;
435+ } else {
436+ panelWidth = window . jQuery ( "#program" ) . width ( ) + 20 ;
437+ }
438+ if ( force || panelWidth != this . prevWidth ) {
439+ if ( this . languages [ this . codeId ] == "blockly" ) {
440+ if ( this . trashInToolbox ) {
441+ window . Blockly . Trashcan . prototype . MARGIN_SIDE_ = panelWidth - 90 ;
442+ }
443+ window . Blockly . svgResize ( this . workspace ) ;
444+ }
445+ }
446+ this . prevWidth = panelWidth ;
447+ }
448+
430449 highlightBlock ( id , keep ) {
431450 if ( ! id ) {
432451 keep = false ;
0 commit comments