File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -819,8 +819,21 @@ function handle_cmds(dcmds) {
819
819
case 'local_light' : { glowObjs [ idx ] = local_light ( cfg ) ; break }
820
820
case 'distant_light' : { glowObjs [ idx ] = distant_light ( cfg ) ; break }
821
821
case 'canvas' : {
822
+ var container = document . getElementById ( "glowscript" ) ;
823
+ if ( container !== null ) {
824
+ window . __context = { glowscript_container : $ ( "#glowscript" ) . removeAttr ( "id" ) }
825
+ }
822
826
glowObjs [ idx ] = canvas ( cfg )
823
827
glowObjs [ idx ] [ 'idx' ] = idx
828
+ try {
829
+ glowObjs [ idx ] . wrapper [ 0 ] . addEventListener ( "contextmenu" , function ( event ) {
830
+ event . preventDefault ( ) ;
831
+ event . stopPropagation ( ) ;
832
+ } ) ;
833
+ }
834
+ catch ( err ) {
835
+ console . log ( "glowcomm canvas contextmenu event : " , err . message ) ;
836
+ }
824
837
break
825
838
// Display frames per second and render time:
826
839
//$("<div id='fps'/>").appendTo(glowObjs[idx].title)
You can’t perform that action at this time.
0 commit comments