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) {
537
537
}
538
538
} else if ( textattrs . indexOf ( attr ) > - 1 ) {
539
539
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 ) }
541
547
} else {
542
548
// '\n' doesn't survive JSON transmission, so in vpython.py we replace '\n' with '<br>'
543
549
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):
3339
3339
def setup (self , args ):
3340
3340
super (controls , self ).__init__ () ## get idx, attrsupdt from baseObj
3341
3341
## default values of common attributes
3342
+ self ._disabled = False
3342
3343
self ._constructing = True
3343
3344
argsToSend = []
3344
3345
objName = args ['_objName' ]
Original file line number Diff line number Diff line change 459
459
}
460
460
} else if ( textattrs . indexOf ( attr ) > - 1 ) {
461
461
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 ) }
463
469
} else {
464
470
// '\n' doesn't survive JSON transmission, so in vpython.py we replace '\n' with '<br>'
465
471
val = m [ 3 ] . replace ( / < b r > / g, "\n" )
792
798
cfg . objName = obj
793
799
cfg . bind = control_handler
794
800
cfg = fix_location ( cfg )
801
+ console . log ( cfg . choices )
795
802
glowObjs [ idx ] = menu ( cfg )
796
803
if ( cfg [ 'selected' ] === 'None' ) {
797
804
cfg [ 'selected' ] = null
Original file line number Diff line number Diff line change @@ -509,7 +509,13 @@ function decode(data) {
509
509
}
510
510
} else if ( textattrs . indexOf ( attr ) > - 1 ) {
511
511
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 ) }
513
519
} else {
514
520
// '\n' doesn't survive JSON transmission, so in vpython.py we replace '\n' with '<br>'
515
521
val = m [ 3 ] . replace ( / < b r > / g, "\n" )
You can’t perform that action at this time.
0 commit comments