Fixing onrenderhook chain

pull/266/head
Dexter 9 years ago
parent 8eb540db6d
commit 9c84c1318e
No known key found for this signature in database
GPG Key ID: B404EAED384C3FB9

@ -268,8 +268,8 @@ export default function dom ( parsed, source, options, names ) {
if ( templateProperties.onrender ) { if ( templateProperties.onrender ) {
builders.init.addBlock( deindent` builders.init.addBlock( deindent`
if ( options._root ) { if ( options._parent ) {
options._root._renderHooks.push({ fn: template.onrender, context: this }); options._parent._renderHooks.push({ fn: template.onrender, context: this });
} else { } else {
template.onrender.call( this ); template.onrender.call( this );
} }
@ -291,7 +291,7 @@ export default function dom ( parsed, source, options, names ) {
this._handlers = Object.create( null ); this._handlers = Object.create( null );
this._root = options._root; this._parent = options._parent;
this._yield = options._yield; this._yield = options._yield;
${builders.init} ${builders.init}

@ -26,7 +26,7 @@ export default {
const componentInitProperties = [ const componentInitProperties = [
`target: ${!isToplevel ? generator.current.target: 'null'}`, `target: ${!isToplevel ? generator.current.target: 'null'}`,
'_root: component._root || component' '_parent: component'
]; ];
// Component has children, put them in a separate {{yield}} block // Component has children, put them in a separate {{yield}} block

Loading…
Cancel
Save