@@ -41,34 +41,24 @@ export default Component.extend({
41
41
this . _wormholeHeadNode = this . _dom . createTextNode ( '' ) ;
42
42
this . _wormholeTailNode = this . _dom . createTextNode ( '' ) ;
43
43
44
- // A prop to help in the mocking of didInsertElement timing for Fastboot
45
- this . _didInsert = false ;
46
- } ,
47
-
48
- /*
49
- * didInsertElement does not fire in Fastboot. Here we use willRender and
50
- * a _didInsert property to approximate the timing. Importantly we want
51
- * to run appendToDestination after the child nodes have rendered.
52
- */
53
- willRender ( ) {
54
- this . _super ( ...arguments ) ;
55
- if ( ! this . _didInsert ) {
56
- this . _didInsert = true ;
57
- run . schedule ( 'afterRender' , ( ) => {
58
- if ( this . isDestroyed ) { return ; }
59
- this . _element = this . _wormholeHeadNode . parentNode ;
60
- if ( ! this . _element ) {
61
- throw new Error ( 'The head node of a wormhole must be attached to the DOM' ) ;
62
- }
63
- this . _appendToDestination ( ) ;
64
- } ) ;
65
- }
44
+ /*
45
+ * didInsertElement does not fire in Fastboot, so we schedule this in
46
+ * init to be run after render. Importantly, we want to run
47
+ * appendToDestination after the child nodes have rendered.
48
+ */
49
+ run . schedule ( 'afterRender' , ( ) => {
50
+ if ( this . isDestroyed ) { return ; }
51
+ this . _element = this . _wormholeHeadNode . parentNode ;
52
+ if ( ! this . _element ) {
53
+ throw new Error ( 'The head node of a wormhole must be attached to the DOM' ) ;
54
+ }
55
+ this . _appendToDestination ( ) ;
56
+ } ) ;
66
57
} ,
67
58
68
59
willDestroyElement : function ( ) {
69
60
// not called in fastboot
70
61
this . _super ( ...arguments ) ;
71
- this . _didInsert = false ;
72
62
let { _wormholeHeadNode, _wormholeTailNode } = this ;
73
63
run . schedule ( 'render' , ( ) => {
74
64
this . _removeRange ( _wormholeHeadNode , _wormholeTailNode ) ;
0 commit comments