File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
vpython/vpython_libraries Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -774,8 +774,21 @@ function handle_cmds(dcmds) {
774
774
case 'local_light' : { glowObjs [ idx ] = local_light ( cfg ) ; break }
775
775
case 'distant_light' : { glowObjs [ idx ] = distant_light ( cfg ) ; break }
776
776
case 'canvas' : {
777
+ var container = document . getElementById ( "glowscript" ) ;
778
+ if ( container !== null ) {
779
+ window . __context = { glowscript_container : $ ( "#glowscript" ) . removeAttr ( "id" ) }
780
+ }
777
781
glowObjs [ idx ] = canvas ( cfg )
778
782
glowObjs [ idx ] [ 'idx' ] = idx
783
+ try {
784
+ glowObjs [ idx ] . wrapper [ 0 ] . addEventListener ( "contextmenu" , function ( event ) {
785
+ event . preventDefault ( ) ;
786
+ event . stopPropagation ( ) ;
787
+ } ) ;
788
+ }
789
+ catch ( err ) {
790
+ console . log ( "glowcomm canvas contextmenu event : " , err . message ) ;
791
+ }
779
792
break
780
793
// Display frames per second and render time:
781
794
//$("<div id='fps'/>").appendTo(glowObjs[idx].title)
You can’t perform that action at this time.
0 commit comments