diff options
Diffstat (limited to 'js/document/views')
-rwxr-xr-x | js/document/views/base.js | 2 | ||||
-rwxr-xr-x | js/document/views/design.js | 15 |
2 files changed, 14 insertions, 3 deletions
diff --git a/js/document/views/base.js b/js/document/views/base.js index db72cc60..d13dce1a 100755 --- a/js/document/views/base.js +++ b/js/document/views/base.js | |||
@@ -28,7 +28,7 @@ exports.BaseDocumentView = Montage.create(Component, { | |||
28 | value: null | 28 | value: null |
29 | }, | 29 | }, |
30 | //////////////////////////////////////////////////////////////////// | 30 | //////////////////////////////////////////////////////////////////// |
31 | // | 31 | //TODO: This should be renamed to better illustrate it's a container (iframe for design, div for code view) |
32 | iframe: { | 32 | iframe: { |
33 | get: function() {return this._iframe;}, | 33 | get: function() {return this._iframe;}, |
34 | set: function(value) {this._iframe= value;} | 34 | set: function(value) {this._iframe= value;} |
diff --git a/js/document/views/design.js b/js/document/views/design.js index 13f89692..d772aa86 100755 --- a/js/document/views/design.js +++ b/js/document/views/design.js | |||
@@ -113,7 +113,7 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, { | |||
113 | render: { | 113 | render: { |
114 | value: function (callback, template) { | 114 | value: function (callback, template) { |
115 | //TODO: Remove, this is a temp patch for webRequest API gate | 115 | //TODO: Remove, this is a temp patch for webRequest API gate |
116 | this.application.ninja.documentController._hackRootFlag = false; | 116 | this.application.ninja.documentController.redirectRequests = false; |
117 | //Storing callback for dispatch ready | 117 | //Storing callback for dispatch ready |
118 | this._callback = callback; | 118 | this._callback = callback; |
119 | this._template = template; | 119 | this._template = template; |
@@ -131,7 +131,8 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, { | |||
131 | // | 131 | // |
132 | onTemplateLoad: { | 132 | onTemplateLoad: { |
133 | value: function (e) { | 133 | value: function (e) { |
134 | this.application.ninja.documentController._hackRootFlag = true; | 134 | //console.log(this.iframe.contentWindow); |
135 | this.application.ninja.documentController.redirectRequests = true; | ||
135 | //TODO: Add support to constructing URL with a base HREF | 136 | //TODO: Add support to constructing URL with a base HREF |
136 | var basetag = this.content.document.getElementsByTagName('base'); | 137 | var basetag = this.content.document.getElementsByTagName('base'); |
137 | //Removing event | 138 | //Removing event |
@@ -279,6 +280,16 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, { | |||
279 | } else { | 280 | } else { |
280 | //Else there is not data to parse | 281 | //Else there is not data to parse |
281 | } | 282 | } |
283 | //TODO: Verify appropiate location for this operation | ||
284 | if (this._template && this._template.type === 'banner') { | ||
285 | this.model.documentRoot = this.document.body.getElementsByTagName('ninja-content')[0]; | ||
286 | } else { | ||
287 | this.model.documentRoot = this.document.body; | ||
288 | } | ||
289 | //Storing node list for reference (might need to store in the model) | ||
290 | this._liveNodeList = this.model.documentRoot.getElementsByTagName('*'); | ||
291 | //Initiliazing document model | ||
292 | document.application.njUtils.makeElementModel(this.model.documentRoot, "Body", "body"); | ||
282 | //Makign callback if specified | 293 | //Makign callback if specified |
283 | if (this._callback) this._callback(); | 294 | if (this._callback) this._callback(); |
284 | } | 295 | } |