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) {
774774 case 'local_light' : { glowObjs [ idx ] = local_light ( cfg ) ; break }
775775 case 'distant_light' : { glowObjs [ idx ] = distant_light ( cfg ) ; break }
776776 case 'canvas' : {
777+ var container = document . getElementById ( "glowscript" ) ;
778+ if ( container !== null ) {
779+ window . __context = { glowscript_container : $ ( "#glowscript" ) . removeAttr ( "id" ) }
780+ }
777781 glowObjs [ idx ] = canvas ( cfg )
778782 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+ }
779792 break
780793 // Display frames per second and render time:
781794 //$("<div id='fps'/>").appendTo(glowObjs[idx].title)
You can’t perform that action at this time.
0 commit comments