diff options
Diffstat (limited to 'js/document/views')
-rwxr-xr-x | js/document/views/design.js | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/js/document/views/design.js b/js/document/views/design.js index 2ccb82d1..3f58650e 100755 --- a/js/document/views/design.js +++ b/js/document/views/design.js | |||
@@ -64,6 +64,11 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, { | |||
64 | }, | 64 | }, |
65 | //////////////////////////////////////////////////////////////////// | 65 | //////////////////////////////////////////////////////////////////// |
66 | // | 66 | // |
67 | propertiesPanel: { | ||
68 | value: null | ||
69 | }, | ||
70 | //////////////////////////////////////////////////////////////////// | ||
71 | // | ||
67 | initialize: { | 72 | initialize: { |
68 | value: function (parent) { | 73 | value: function (parent) { |
69 | //Creating iFrame for view | 74 | //Creating iFrame for view |
@@ -184,8 +189,7 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, { | |||
184 | this._bodyFragment = null; | 189 | this._bodyFragment = null; |
185 | //Calling standard method to finish opening document | 190 | //Calling standard method to finish opening document |
186 | this.bodyContentLoaded(null); | 191 | this.bodyContentLoaded(null); |
187 | 192 | //TODO: Move this to be set via the controller | |
188 | // TODO: Clean up this code | ||
189 | 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); |
190 | 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); |
191 | } | 195 | } |
@@ -243,17 +247,15 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, { | |||
243 | } | 247 | } |
244 | } | 248 | } |
245 | } | 249 | } |
246 | //Checking and initializing webGL | 250 | //Checking for script tags then parsing check for montage and webgl |
247 | if (scripttags.length > 0) { | 251 | if (scripttags.length > 0) { |
252 | //Checking and initializing webGL | ||
248 | this.initWebGl(scripttags); | 253 | this.initWebGl(scripttags); |
249 | } //Else there is not data to parse | 254 | //Checking and initializing Montage |
250 | 255 | this.initMontage(scripttags); | |
251 | 256 | } else { | |
252 | 257 | //Else there is not data to parse | |
253 | //TODO: Load Montage Components (blocking) | 258 | } |
254 | //this.initMontage(); | ||
255 | |||
256 | |||
257 | //Makign callback if specified | 259 | //Makign callback if specified |
258 | if (this._callback) this._callback(); | 260 | if (this._callback) this._callback(); |
259 | } | 261 | } |
@@ -350,8 +352,14 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, { | |||
350 | //////////////////////////////////////////////////////////////////// | 352 | //////////////////////////////////////////////////////////////////// |
351 | // | 353 | // |
352 | initMontage: { | 354 | initMontage: { |
353 | value: function () { | 355 | value: function (scripttags) { |
354 | //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); | ||
355 | } | 363 | } |
356 | }, | 364 | }, |
357 | //////////////////////////////////////////////////////////////////// | 365 | //////////////////////////////////////////////////////////////////// |