From 7950424cf704bb221971f4645406b01e6979db18 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Fri, 3 Feb 2012 00:38:13 -0800 Subject: Fix the main user component to create distinct instance of component. - Create a distinct instance of button - Cleanup. Signed-off-by: Valerio Virgillito --- .../montage-application-cloud/main.reel/main.js | 32 ++++++---------------- 1 file changed, 8 insertions(+), 24 deletions(-) (limited to 'user-document-templates/montage-application-cloud') diff --git a/user-document-templates/montage-application-cloud/main.reel/main.js b/user-document-templates/montage-application-cloud/main.reel/main.js index 90262073..b4ed049f 100644 --- a/user-document-templates/montage-application-cloud/main.reel/main.js +++ b/user-document-templates/montage-application-cloud/main.reel/main.js @@ -37,36 +37,20 @@ exports.Main = Montage.create(Component, { switch(componentType.type){ case "Button": - //var tmpFix = ("montage/ui/button.reel"); - //var str = "montage/ui/button.reel"; - var stro = componentType.path; - -// var button = (stro); - - var button = require.async(stro) + var button = require.async(componentType.path) .then(function (button) { - var btIns = button["Button"]; + var buttonObj = button["Button"]; + var btIns = buttonObj.create(); - btIns.element = containerElement; - btIns.deserializedFromTemplate(); + btIns.element = containerElement; + btIns.deserializedFromTemplate(); - btIns.needsDraw = true; - btIns.label = "Button"; - callback(btIns, containerElement); + btIns.needsDraw = true; + btIns.label = "Button"; + callback(btIns, containerElement); }) .end(); - /* - var buttonInstance = button[componentType.name]; - - buttonInstance.element = containerElement; - buttonInstance.deserializedFromTemplate(); - - buttonInstance.needsDraw = true; - buttonInstance.label = "Button"; - - return buttonInstance; - */ break; case "Checkbox": component = Checkbox.create(); -- cgit v1.2.3