@@ -33,7 +33,8 @@ define(["jupyter-js-widgets", "underscore", "three"],
33
33
this . renderer = new THREE . CanvasRenderer ( ) ;
34
34
}
35
35
this . el . className = "jupyter-widget jupyter-threejs" ;
36
- this . $el . empty ( ) . append ( this . renderer . domElement ) ;
36
+ this . el . innerHTML = '' ;
37
+ this . el . appendChild ( this . renderer . domElement ) ;
37
38
var that = this ;
38
39
var view_promises = [ ] ;
39
40
view_promises . push ( this . create_child_view ( this . model . get ( 'camera' ) , render_loop ) . then (
@@ -494,9 +495,8 @@ define(["jupyter-js-widgets", "underscore", "three"],
494
495
this . model . on ( 'change:root' , this . change_root , this ) ;
495
496
this . change_root ( this . model , this . model . get ( 'root' ) ) ;
496
497
this . options . dom . addEventListener ( this . model . get ( 'event' ) , function ( event ) {
497
- var offset = $ ( this ) . offset ( ) ;
498
- var mouseX = ( ( event . pageX - offset . left ) / $ ( that . options . dom ) . width ( ) ) * 2 - 1 ;
499
- var mouseY = - ( ( event . pageY - offset . top ) / $ ( that . options . dom ) . height ( ) ) * 2 + 1 ;
498
+ var mouseX = ( ( event . pageX - this . offsetLeft ) / that . options . dom . getBoundingClientRect ( ) . width ) * 2 - 1 ;
499
+ var mouseY = - ( ( event . pageY - this . offsetTop ) / that . options . dom . getBoundingClientRect ( ) . height ) * 2 + 1 ;
500
500
var vector = new THREE . Vector3 ( mouseX , mouseY , that . options . renderer . camera . obj . near ) ;
501
501
502
502
vector . unproject ( that . options . renderer . camera . obj ) ;
@@ -997,7 +997,7 @@ define(["jupyter-js-widgets", "underscore", "three"],
997
997
var img = new Image ( ) ;
998
998
//img.crossOrigin='anonymous';
999
999
img . src = this . model . get ( 'imageuri' ) ;
1000
- img . onload = $ . proxy ( this . needs_update , this ) ;
1000
+ img . onload = _ . bind ( this . needs_update , this ) ;
1001
1001
this . replace_obj ( new THREE . Texture ( img ) ) ;
1002
1002
ThreeView . prototype . update . call ( this ) ;
1003
1003
} ,
0 commit comments