File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
vpython/vpython_libraries Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 723723 case 'local_light' : { glowObjs [ idx ] = local_light ( cfg ) ; break }
724724 case 'distant_light' : { glowObjs [ idx ] = distant_light ( cfg ) ; break }
725725 case 'canvas' : {
726+ var container = document . getElementById ( "glowscript" ) ;
727+ if ( container !== null ) {
728+ window . __context = { glowscript_container : $ ( "#glowscript" ) . removeAttr ( "id" ) }
729+ }
726730 glowObjs [ idx ] = canvas ( cfg )
727731 glowObjs [ idx ] [ 'idx' ] = idx
732+ try {
733+ glowObjs [ idx ] . wrapper [ 0 ] . addEventListener ( "contextmenu" , function ( event ) {
734+ event . preventDefault ( ) ;
735+ event . stopPropagation ( ) ;
736+ } ) ;
737+ }
738+ catch ( err ) {
739+ console . log ( "glowcomm canvas contextmenu event : " , err . message ) ;
740+ }
728741 break
729742 // Display frames per second and render time:
730743 //$("<div id='fps'/>").appendTo(glowObjs[idx].title)
920933
921934</ script >
922935</ div >
923- </ body >
936+ </ body >
You can’t perform that action at this time.
0 commit comments