File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -303,14 +303,22 @@ define([
303303
304304 var createdBlock = blockContainer . getSelectBlock ( ) ;
305305 if ( createdBlock ) {
306- // apply to original block
307- createdBlock . setState ( {
308- apps : {
309- menu : blockContainer . apps ,
310- code : code ,
311- state : state
312- }
313- } ) ;
306+ if ( title === 'Snippets' ) {
307+ // set code
308+ createdBlock . setState ( {
309+ [ STATE_codeLine ] : code
310+ } ) ;
311+ } else if ( title === 'Import' || title === 'Variables' || title === 'File'
312+ || title === 'Instance' || title === 'Chart' ) {
313+ // apply to original block
314+ createdBlock . setState ( {
315+ apps : {
316+ menu : blockContainer . apps ,
317+ code : code ,
318+ state : state
319+ }
320+ } ) ;
321+ }
314322 createdBlock . saveState ( ) ;
315323 } else {
316324 if ( title === 'Snippets' ) {
Original file line number Diff line number Diff line change @@ -220,7 +220,7 @@ define([
220220 ' return 0.0' ,
221221 ' else:' ,
222222 ' try:' ,
223- ' result = float(x)' ,
223+ ' result = float(x)' ,
224224 ' return result' ,
225225 ' except ValueError:' ,
226226 ' return 0.0'
You can’t perform that action at this time.
0 commit comments