diff options
author | Valerio Virgillito | 2012-05-18 16:36:07 -0700 |
---|---|---|
committer | Valerio Virgillito | 2012-05-18 16:36:07 -0700 |
commit | e7c288fe8f5d3a9e5c9f0eb0a045c6c195a0e7b8 (patch) | |
tree | 0b0ac15a0dd11a5996bd0c357693df62d1029669 /js/document/views | |
parent | fdfba499f0b84360b96096fa866a981e96e8756c (diff) | |
parent | 1056a45e0cbf92d578324ce70b8a17183320e64b (diff) | |
download | ninja-e7c288fe8f5d3a9e5c9f0eb0a045c6c195a0e7b8.tar.gz |
Merge branch 'dom-architecture' of github.com:Motorola-Mobility/ninja-internal into dom-architecture
Diffstat (limited to 'js/document/views')
-rwxr-xr-x | js/document/views/design.js | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/js/document/views/design.js b/js/document/views/design.js index 44f1a5e8..3f58650e 100755 --- a/js/document/views/design.js +++ b/js/document/views/design.js | |||
@@ -189,8 +189,7 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, { | |||
189 | this._bodyFragment = null; | 189 | this._bodyFragment = null; |
190 | //Calling standard method to finish opening document | 190 | //Calling standard method to finish opening document |
191 | this.bodyContentLoaded(null); | 191 | this.bodyContentLoaded(null); |
192 | 192 | //TODO: Move this to be set via the controller | |
193 | // TODO: Clean up this code | ||
194 | this.application.ninja.stage.documentOffsetLeft = parseInt((this.document.body.scrollWidth - this._template.size.width)/2); | 193 | this.application.ninja.stage.documentOffsetLeft = parseInt((this.document.body.scrollWidth - this._template.size.width)/2); |
195 | this.application.ninja.stage.documentOffsetTop = parseInt((this.document.body.scrollHeight - this._template.size.height)/2); | 194 | this.application.ninja.stage.documentOffsetTop = parseInt((this.document.body.scrollHeight - this._template.size.height)/2); |
196 | } | 195 | } |
@@ -248,17 +247,15 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, { | |||
248 | } | 247 | } |
249 | } | 248 | } |
250 | } | 249 | } |
251 | //Checking and initializing webGL | 250 | //Checking for script tags then parsing check for montage and webgl |
252 | if (scripttags.length > 0) { | 251 | if (scripttags.length > 0) { |
252 | //Checking and initializing webGL | ||
253 | this.initWebGl(scripttags); | 253 | this.initWebGl(scripttags); |
254 | } //Else there is not data to parse | 254 | //Checking and initializing Montage |
255 | 255 | this.initMontage(scripttags); | |
256 | 256 | } else { | |
257 | 257 | //Else there is not data to parse | |
258 | //TODO: Load Montage Components (blocking) | 258 | } |
259 | //this.initMontage(); | ||
260 | |||
261 | |||
262 | //Makign callback if specified | 259 | //Makign callback if specified |
263 | if (this._callback) this._callback(); | 260 | if (this._callback) this._callback(); |
264 | } | 261 | } |
@@ -355,8 +352,14 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, { | |||
355 | //////////////////////////////////////////////////////////////////// | 352 | //////////////////////////////////////////////////////////////////// |
356 | // | 353 | // |
357 | initMontage: { | 354 | initMontage: { |
358 | value: function () { | 355 | value: function (scripttags) { |
359 | //initWithDocument(window.document) instantiateWithOwnerAndDocument(null, window.document) | 356 | // |
357 | this.iframe.contentWindow.document.body.addEventListener('mjsTemplateReady', function () { | ||
358 | //Initializing template with user's seriliazation | ||
359 | var template = this.iframe.contentWindow.mjsTemplate.create(); | ||
360 | template.initWithDocument(this.iframe.contentWindow.document); | ||
361 | template.instantiateWithOwnerAndDocument(null, this.iframe.contentWindow.document, function (e){/*Nothing just a required extra parameter*/}); | ||
362 | }.bind(this), false); | ||
360 | } | 363 | } |
361 | }, | 364 | }, |
362 | //////////////////////////////////////////////////////////////////// | 365 | //////////////////////////////////////////////////////////////////// |