aboutsummaryrefslogtreecommitdiff
path: root/js/document/views
diff options
context:
space:
mode:
authorValerio Virgillito2012-05-24 11:59:17 -0700
committerValerio Virgillito2012-05-24 11:59:17 -0700
commit70ff8dd670bc37c14caf850e06791d1e293b1e4b (patch)
tree8e00a27c6c908dda3e816d1f5aaf0d2a889ca5dc /js/document/views
parenta8eb5c65a21af3bf8d8b8eb3e65b494b8bd9bc01 (diff)
parenta6db492176a85546047dae6d5ecb9cfc4325e043 (diff)
downloadninja-70ff8dd670bc37c14caf850e06791d1e293b1e4b.tar.gz
Merge pull request #255 from joseeight/Document
Cleaning up referencing to documentRoot
Diffstat (limited to 'js/document/views')
-rwxr-xr-xjs/document/views/base.js2
-rwxr-xr-xjs/document/views/design.js15
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 }