diff options
Diffstat (limited to 'user-document-templates')
-rw-r--r-- | user-document-templates/montage-application-cloud/main.reel/main.js | 14 |
1 files changed, 11 insertions, 3 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 415794d8..036d6c24 100644 --- a/user-document-templates/montage-application-cloud/main.reel/main.js +++ b/user-document-templates/montage-application-cloud/main.reel/main.js | |||
@@ -32,17 +32,24 @@ exports.Main = Montage.create(Component, { | |||
32 | }, | 32 | }, |
33 | 33 | ||
34 | addComponentToUserDocument:{ | 34 | addComponentToUserDocument:{ |
35 | value:function(containerElement, componentType){ | 35 | value:function(containerElement, componentType, callback){ |
36 | var component = null; | 36 | var component = null; |
37 | switch(componentType.type){ | 37 | switch(componentType.type){ |
38 | case "Button": | 38 | case "Button": |
39 | 39 | ||
40 | //var tmpFix = require("montage/ui/button.reel"); | 40 | //var tmpFix = ("montage/ui/button.reel"); |
41 | //var str = "montage/ui/button.reel"; | 41 | //var str = "montage/ui/button.reel"; |
42 | var stro = componentType.path; | 42 | var stro = componentType.path; |
43 | 43 | ||
44 | var button = require(stro); | 44 | // var button = (stro); |
45 | 45 | ||
46 | var button = require.async(stro) | ||
47 | .then(function (button) { | ||
48 | callback(); | ||
49 | }) | ||
50 | .end(); | ||
51 | |||
52 | /* | ||
46 | var buttonInstance = button[componentType.name]; | 53 | var buttonInstance = button[componentType.name]; |
47 | 54 | ||
48 | buttonInstance.element = containerElement; | 55 | buttonInstance.element = containerElement; |
@@ -52,6 +59,7 @@ exports.Main = Montage.create(Component, { | |||
52 | buttonInstance.label = "Button"; | 59 | buttonInstance.label = "Button"; |
53 | 60 | ||
54 | return buttonInstance; | 61 | return buttonInstance; |
62 | */ | ||
55 | break; | 63 | break; |
56 | case "Checkbox": | 64 | case "Checkbox": |
57 | component = Checkbox.create(); | 65 | component = Checkbox.create(); |