diff options
Diffstat (limited to 'node_modules/tools/template')
-rwxr-xr-x | node_modules/tools/template/template-creator.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/node_modules/tools/template/template-creator.js b/node_modules/tools/template/template-creator.js index 4ba1b443..01a2518b 100755 --- a/node_modules/tools/template/template-creator.js +++ b/node_modules/tools/template/template-creator.js | |||
@@ -35,6 +35,7 @@ var TemplateCreator = exports.TemplateCreator = Montage.create(Template, /** @le | |||
35 | var serializer = this.serializer, | 35 | var serializer = this.serializer, |
36 | objects = {}, | 36 | objects = {}, |
37 | components = {}, | 37 | components = {}, |
38 | componentsChildComponents = {}, | ||
38 | doc, | 39 | doc, |
39 | script, | 40 | script, |
40 | self = this; | 41 | self = this; |
@@ -54,6 +55,8 @@ var TemplateCreator = exports.TemplateCreator = Montage.create(Template, /** @le | |||
54 | label = self._generateLabelForComponent(component, Object.keys(components)); | 55 | label = self._generateLabelForComponent(component, Object.keys(components)); |
55 | component._element = targetNode; | 56 | component._element = targetNode; |
56 | components[label] = component; | 57 | components[label] = component; |
58 | componentsChildComponents[label] = component.childComponents; | ||
59 | delete component.childComponents; | ||
57 | } else { | 60 | } else { |
58 | for (var i = 0; (childNode = childNodes[i]); i++) { | 61 | for (var i = 0; (childNode = childNodes[i]); i++) { |
59 | targetChildNode = targetNode.appendChild(childNode.cloneNode(false)); | 62 | targetChildNode = targetNode.appendChild(childNode.cloneNode(false)); |
@@ -84,6 +87,10 @@ var TemplateCreator = exports.TemplateCreator = Montage.create(Template, /** @le | |||
84 | 87 | ||
85 | copyNode(body, this._document.body, true); | 88 | copyNode(body, this._document.body, true); |
86 | this._ownerSerialization = serializer.serialize(components); | 89 | this._ownerSerialization = serializer.serialize(components); |
90 | for (var label in components) { | ||
91 | components[label].childComponents = componentsChildComponents[label]; | ||
92 | } | ||
93 | components = componentsChildComponents = null; | ||
87 | this._externalObjects = serializer.getExternalObjects(); | 94 | this._externalObjects = serializer.getExternalObjects(); |
88 | 95 | ||
89 | return this; | 96 | return this; |