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/tools/template/template-creator.js') 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 From a869cd3619b783e29cf320f46713b0c790edb15f Mon Sep 17 00:00:00 2001 From: Kris Kowal Date: Fri, 6 Jul 2012 10:57:37 -0700 Subject: Update copyright boilerplate --- node_modules/tools/template/template-creator.js | 34 +++++++++++++++++++++---- 1 file changed, 29 insertions(+), 5 deletions(-) (limited to 'node_modules/tools/template/template-creator.js') diff --git a/node_modules/tools/template/template-creator.js b/node_modules/tools/template/template-creator.js index faf03520..9951fb02 100755 --- a/node_modules/tools/template/template-creator.js +++ b/node_modules/tools/template/template-creator.js @@ -1,8 +1,32 @@ /* - This file contains proprietary software owned by Motorola Mobility, Inc.
- No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.
- (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. -
*/ +Copyright (c) 2012, Motorola Mobility, Inc +All Rights Reserved. +BSD License. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + - Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + - Neither the name of Motorola Mobility nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + */ /** @module montage/tools/template/template-creator @requires montage/ui/template @@ -124,4 +148,4 @@ var TemplateCreator = exports.TemplateCreator = Montage.create(Template, /** @le return componentName + index; } }}, -}); \ No newline at end of file +}); -- cgit v1.2.3