Skip to content

Commit 2a0264d

Browse files
committed
CSS3DObject now notifies its children of removal.
Maybe the event name could be removed_from_scene instead...
1 parent 3f580a5 commit 2a0264d

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

examples/js/renderers/CSS3DRenderer.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,18 @@ THREE.CSS3DObject = function ( element ) {
1414
this.element.style.oTransformStyle = 'preserve-3d';
1515
this.element.style.transformStyle = 'preserve-3d';
1616

17-
this.addEventListener( 'removed', function () {
17+
this.addEventListener( 'removed', function ( event ) {
1818

1919
if ( this.element.parentNode !== null ) {
2020

2121
this.element.parentNode.removeChild( this.element );
2222

23+
for ( var i = 0, l = this.children.length; i < l; i ++ ) {
24+
25+
this.children[ i ].dispatchEvent( event );
26+
27+
}
28+
2329
}
2430

2531
} );

0 commit comments

Comments
 (0)