From 6a0f150f49be656e0725bc77b452a3141dddd47c Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Wed, 6 Jun 2012 13:46:02 -0700 Subject: Cleaning up Removed reference of model in design view, clean up slightly, need to implement binding later. --- js/document/views/design.js | 46 ++++++++++++++++++++++++++++++++------------- 1 file changed, 33 insertions(+), 13 deletions(-) (limited to 'js/document/views') diff --git a/js/document/views/design.js b/js/document/views/design.js index f7fbf3c5..53590944 100755 --- a/js/document/views/design.js +++ b/js/document/views/design.js @@ -51,11 +51,6 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, { content: { value: null }, - //////////////////////////////////////////////////////////////////// - //TODO: Remove usage - model: { - value: null - }, //////////////////////////////////////////////////////////////////// // document: { @@ -69,6 +64,33 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, { }, //////////////////////////////////////////////////////////////////// // + _baseHref: { + value: null + }, + //////////////////////////////////////////////////////////////////// + // + baseHref: { + get: function() {return this._baseHref;}, + set: function(value) {this._baseHref = value;} + }, + //////////////////////////////////////////////////////////////////// + // + _documentRoot: { + value: null + }, + //////////////////////////////////////////////////////////////////// + // + documentRoot: { + get: function() {return this._documentRoot;}, + set: function(value) {this._documentRoot = value;} + }, + //////////////////////////////////////////////////////////////////// + // + _webGlHelper: { + value: null + }, + //////////////////////////////////////////////////////////////////// + // getLiveNodeList: { value: function(useFilter) { if(useFilter) { @@ -142,7 +164,7 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, { if (basetag.length) { if (basetag[basetag.length-1].getAttribute && basetag[basetag.length-1].getAttribute('href')) { //Setting base HREF in model - this.model.baseHref = basetag[basetag.length-1].getAttribute('href'); + this.baseHref = basetag[basetag.length-1].getAttribute('href'); } } //Checking to content to be template @@ -275,12 +297,12 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, { } //TODO: Verify appropiate location for this operation if (this._template && this._template.type === 'banner') { - this.model.documentRoot = this.document.body.getElementsByTagName('ninja-content')[0]; + this.documentRoot = this.document.body.getElementsByTagName('ninja-content')[0]; } else { - this.model.documentRoot = this.document.body; + this.documentRoot = this.document.body; } //Storing node list for reference (might need to store in the model) - this._liveNodeList = this.model.documentRoot.getElementsByTagName('*'); + this._liveNodeList = this.documentRoot.getElementsByTagName('*'); //Getting list of original nodes orgNodes = this.document.getElementsByTagName('*'); //TODO: Figure out if this is ideal for identifying nodes created by Ninja @@ -288,7 +310,7 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, { if (orgNodes[n].getAttribute) orgNodes[n].setAttribute('data-ninja-node', 'true'); } //Initiliazing document model - document.application.njUtils.makeElementModel(this.model.documentRoot, "Body", "body"); + document.application.njUtils.makeElementModel(this.documentRoot, "Body", "body"); //Makign callback if specified if (this._callback) this._callback(); } @@ -358,8 +380,6 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, { value: function (scripttags) { // var n, webgldata, fileRead; - //Setting the iFrame property for reference in helper class - this.model.webGlHelper.iframe = this.model.views.design.iframe; //Checking for webGL Data for (var w in scripttags) { // @@ -385,7 +405,7 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, { webgldata.data[n] = unescape(webgldata.data[n]); } //TODO: Improve setter of webGL and reference - this.model.webGlHelper.glData = webgldata.data; + this._webGlHelper.glData = webgldata.data; } } } -- cgit v1.2.3