File tree Expand file tree Collapse file tree 4 files changed +23
-3
lines changed Expand file tree Collapse file tree 4 files changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -537,7 +537,13 @@ function decode(data) {
537537 }
538538 } else if ( textattrs . indexOf ( attr ) > - 1 ) {
539539 if ( attr == 'choices' ) { // menu choices to be wrapped in a list
540- val = m [ 3 ] . split ( ' ' )
540+ val = m [ 3 ] . slice ( 2 , - 2 )
541+ val = val . replace ( / ' / g, '' ) // remove quotes
542+ val = val . replace ( / , / g, '' ) // remove commas
543+ let s = val . split ( ' ' )
544+ val = [ ]
545+ let a
546+ for ( a of s ) { val . push ( a ) }
541547 } else {
542548 // '\n' doesn't survive JSON transmission, so in vpython.py we replace '\n' with '<br>'
543549 val = m [ 3 ] . replace ( / < b r > / g, "\n" )
Original file line number Diff line number Diff line change @@ -3339,6 +3339,7 @@ class controls(baseObj):
33393339 def setup (self , args ):
33403340 super (controls , self ).__init__ () ## get idx, attrsupdt from baseObj
33413341 ## default values of common attributes
3342+ self ._disabled = False
33423343 self ._constructing = True
33433344 argsToSend = []
33443345 objName = args ['_objName' ]
Original file line number Diff line number Diff line change 459459 }
460460 } else if ( textattrs . indexOf ( attr ) > - 1 ) {
461461 if ( attr == 'choices' ) { // menu choices to be wrapped in a list
462- val = m [ 3 ] . split ( ' ' )
462+ val = m [ 3 ] . slice ( 2 , - 2 )
463+ val = val . replace ( / ' / g, '' ) // remove quotes
464+ val = val . replace ( / , / g, '' ) // remove commas
465+ let s = val . split ( ' ' )
466+ val = [ ]
467+ let a
468+ for ( a of s ) { val . push ( a ) }
463469 } else {
464470 // '\n' doesn't survive JSON transmission, so in vpython.py we replace '\n' with '<br>'
465471 val = m [ 3 ] . replace ( / < b r > / g, "\n" )
792798 cfg . objName = obj
793799 cfg . bind = control_handler
794800 cfg = fix_location ( cfg )
801+ console . log ( cfg . choices )
795802 glowObjs [ idx ] = menu ( cfg )
796803 if ( cfg [ 'selected' ] === 'None' ) {
797804 cfg [ 'selected' ] = null
Original file line number Diff line number Diff line change @@ -509,7 +509,13 @@ function decode(data) {
509509 }
510510 } else if ( textattrs . indexOf ( attr ) > - 1 ) {
511511 if ( attr == 'choices' ) { // menu choices to be wrapped in a list
512- val = m [ 3 ] . split ( ' ' )
512+ val = m [ 3 ] . slice ( 2 , - 2 )
513+ val = val . replace ( / ' / g, '' ) // remove quotes
514+ val = val . replace ( / , / g, '' ) // remove commas
515+ let s = val . split ( ' ' )
516+ val = [ ]
517+ let a
518+ for ( a of s ) { val . push ( a ) }
513519 } else {
514520 // '\n' doesn't survive JSON transmission, so in vpython.py we replace '\n' with '<br>'
515521 val = m [ 3 ] . replace ( / < b r > / g, "\n" )
You can’t perform that action at this time.
0 commit comments