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 723
723
case 'local_light' : { glowObjs [ idx ] = local_light ( cfg ) ; break }
724
724
case 'distant_light' : { glowObjs [ idx ] = distant_light ( cfg ) ; break }
725
725
case 'canvas' : {
726
+ var container = document . getElementById ( "glowscript" ) ;
727
+ if ( container !== null ) {
728
+ window . __context = { glowscript_container : $ ( "#glowscript" ) . removeAttr ( "id" ) }
729
+ }
726
730
glowObjs [ idx ] = canvas ( cfg )
727
731
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
+ }
728
741
break
729
742
// Display frames per second and render time:
730
743
//$("<div id='fps'/>").appendTo(glowObjs[idx].title)
920
933
921
934
</ script >
922
935
</ div >
923
- </ body >
936
+ </ body >
You can’t perform that action at this time.
0 commit comments