diff options
author | Armen Kesablyan | 2012-06-20 15:04:25 -0700 |
---|---|---|
committer | Armen Kesablyan | 2012-06-20 15:04:25 -0700 |
commit | fc818d31de267d2b77fda3b3029ad38d48698be8 (patch) | |
tree | 122ebf54d3378578c1ded4d786ba3940d4a911d2 /node_modules/montage/ui/application.js | |
parent | 120e31dcf1e11eed11ee430d77c438e7b073e9f8 (diff) | |
parent | c9852665eadc1acb9c1c881d207c4bd9ef88805f (diff) | |
download | ninja-fc818d31de267d2b77fda3b3029ad38d48698be8.tar.gz |
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal
Diffstat (limited to 'node_modules/montage/ui/application.js')
-rwxr-xr-x | node_modules/montage/ui/application.js | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/node_modules/montage/ui/application.js b/node_modules/montage/ui/application.js index bbce6835..025ef950 100755 --- a/node_modules/montage/ui/application.js +++ b/node_modules/montage/ui/application.js | |||
@@ -137,28 +137,27 @@ var Application = exports.Application = Montage.create(Montage, /** @lends monta | |||
137 | value: null | 137 | value: null |
138 | }, | 138 | }, |
139 | 139 | ||
140 | /** | 140 | _load: { |
141 | Description TODO | 141 | value: function(applicationRequire, callback) { |
142 | @function | 142 | var template = Template.create().initWithDocument(window.document, applicationRequire), |
143 | @param {Function} callback A function to invoke after the method has completed. | 143 | rootComponent, |
144 | */ | ||
145 | load: { | ||
146 | value: function(callback) { | ||
147 | var template = Template.create().initWithDocument(window.document), | ||
148 | component, | ||
149 | self = this; | 144 | self = this; |
150 | 145 | ||
151 | self = Application.isPrototypeOf(self) ? self : Application.create(); | ||
152 | |||
153 | // assign to the exports so that it is available in the deserialization of the template | 146 | // assign to the exports so that it is available in the deserialization of the template |
154 | exports.application = self; | 147 | exports.application = self; |
155 | 148 | ||
156 | template.instantiateWithOwnerAndDocument(null, window.document, function() { | 149 | require.async("ui/component").then(function(exports) { |
157 | require("ui/component").__root__.needsDraw = true; | 150 | rootComponent = exports.__root__; |
158 | if (callback) { | 151 | rootComponent.element = document; |
159 | callback(self); | 152 | template.instantiateWithOwnerAndDocument(null, window.document, function() { |
160 | } | 153 | self.callDelegateMethod("willFinishLoading", self); |
161 | }); | 154 | rootComponent.needsDraw = true; |
155 | if (callback) { | ||
156 | callback(self); | ||
157 | } | ||
158 | |||
159 | }); | ||
160 | }).end(); | ||
162 | } | 161 | } |
163 | }, | 162 | }, |
164 | 163 | ||