diff options
author | Valerio Virgillito | 2012-02-03 00:38:13 -0800 |
---|---|---|
committer | Valerio Virgillito | 2012-02-03 00:38:13 -0800 |
commit | 7950424cf704bb221971f4645406b01e6979db18 (patch) | |
tree | 6c9d208a2bc8c0d2da6a9001681787bbe1d6a14b /user-document-templates | |
parent | 197ae04f7677b7a5890a589ba572e750a229c502 (diff) | |
download | ninja-7950424cf704bb221971f4645406b01e6979db18.tar.gz |
Fix the main user component to create distinct instance of component.
- Create a distinct instance of button
- Cleanup.
Signed-off-by: Valerio Virgillito <valerio@motorola.com>
Diffstat (limited to 'user-document-templates')
-rw-r--r-- | user-document-templates/montage-application-cloud/main.reel/main.js | 32 |
1 files changed, 8 insertions, 24 deletions
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, { | |||
37 | switch(componentType.type){ | 37 | switch(componentType.type){ |
38 | case "Button": | 38 | case "Button": |
39 | 39 | ||
40 | //var tmpFix = ("montage/ui/button.reel"); | 40 | var button = require.async(componentType.path) |
41 | //var str = "montage/ui/button.reel"; | ||
42 | var stro = componentType.path; | ||
43 | |||
44 | // var button = (stro); | ||
45 | |||
46 | var button = require.async(stro) | ||
47 | .then(function (button) { | 41 | .then(function (button) { |
48 | var btIns = button["Button"]; | 42 | var buttonObj = button["Button"]; |
43 | var btIns = buttonObj.create(); | ||
49 | 44 | ||
50 | btIns.element = containerElement; | 45 | btIns.element = containerElement; |
51 | btIns.deserializedFromTemplate(); | 46 | btIns.deserializedFromTemplate(); |
52 | 47 | ||
53 | btIns.needsDraw = true; | 48 | btIns.needsDraw = true; |
54 | btIns.label = "Button"; | 49 | btIns.label = "Button"; |
55 | callback(btIns, containerElement); | 50 | callback(btIns, containerElement); |
56 | }) | 51 | }) |
57 | .end(); | 52 | .end(); |
58 | 53 | ||
59 | /* | ||
60 | var buttonInstance = button[componentType.name]; | ||
61 | |||
62 | buttonInstance.element = containerElement; | ||
63 | buttonInstance.deserializedFromTemplate(); | ||
64 | |||
65 | buttonInstance.needsDraw = true; | ||
66 | buttonInstance.label = "Button"; | ||
67 | |||
68 | return buttonInstance; | ||
69 | */ | ||
70 | break; | 54 | break; |
71 | case "Checkbox": | 55 | case "Checkbox": |
72 | component = Checkbox.create(); | 56 | component = Checkbox.create(); |