From 5497e1d7776b8fd90d55ef5614c97e87a2e34d34 Mon Sep 17 00:00:00 2001 From: António Afonso Date: Tue, 3 Jul 2012 11:04:29 -0700 Subject: gh-329 Make Template Creator restore the elements after serialization To create the serialization the element of each component needs to point to a new one, since the code was not restoring these elements the components were left in an undefined state.--- node_modules/tools/template/template-creator.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'node_modules') diff --git a/node_modules/tools/template/template-creator.js b/node_modules/tools/template/template-creator.js index 7cc66093..faf03520 100755 --- a/node_modules/tools/template/template-creator.js +++ b/node_modules/tools/template/template-creator.js @@ -36,6 +36,7 @@ var TemplateCreator = exports.TemplateCreator = Montage.create(Template, /** @le objects = {}, components = {}, componentsChildComponents = {}, + componentsElements = {}, doc, script, self = this; @@ -54,6 +55,7 @@ var TemplateCreator = exports.TemplateCreator = Montage.create(Template, /** @le if (component) { label = self._generateLabelForComponent(component, Object.keys(components)); + componentsElements[label] = component._element; component._element = targetNode; components[label] = component; componentsChildComponents[label] = component.childComponents; @@ -91,6 +93,7 @@ var TemplateCreator = exports.TemplateCreator = Montage.create(Template, /** @le this._ownerSerialization = serializer.serialize(components); for (var label in components) { components[label].childComponents = componentsChildComponents[label]; + components[label]._element = componentsElements[label]; } components = componentsChildComponents = null; this._externalObjects = serializer.getExternalObjects(); -- cgit v1.2.3