aboutsummaryrefslogtreecommitdiff
path: root/js/document/document-html.js
diff options
context:
space:
mode:
authorValerio Virgillito2012-05-16 00:54:40 -0700
committerValerio Virgillito2012-05-16 00:54:40 -0700
commita9672abd32c2e03b8607c1af4903c90f7ff9531c (patch)
tree30da60ed624d3d60b09fc04672c502bbed3b11f8 /js/document/document-html.js
parent6dfe2e62b1d7a71daf097aac3a31213d564e6122 (diff)
parent2b21e91a3343229bb87179e08be1e532fcf9b8f9 (diff)
downloadninja-a9672abd32c2e03b8607c1af4903c90f7ff9531c.tar.gz
Merge branch 'dom-architecture' of github.com:Motorola-Mobility/ninja-internal into dom-architecture
Diffstat (limited to 'js/document/document-html.js')
-rwxr-xr-xjs/document/document-html.js32
1 files changed, 7 insertions, 25 deletions
diff --git a/js/document/document-html.js b/js/document/document-html.js
index 4767271f..87c776d5 100755
--- a/js/document/document-html.js
+++ b/js/document/document-html.js
@@ -43,13 +43,6 @@ exports.HtmlDocument = Montage.create(Component, {
43 exclusionList: { 43 exclusionList: {
44 value: ["HTML", "BODY"] //TODO: Update to correct list 44 value: ["HTML", "BODY"] //TODO: Update to correct list
45 }, 45 },
46 ////////////////////////////////////////////////////////////////////
47 //
48 uuid: {
49 get: function() {
50 return this._uuid;
51 }
52 },
53 //////////////////////////////////////////////////////////////////// 46 ////////////////////////////////////////////////////////////////////
54 // 47 //
55 inExclusion: { 48 inExclusion: {
@@ -100,14 +93,14 @@ exports.HtmlDocument = Montage.create(Component, {
100 this._document = this.model.views.design.document; 93 this._document = this.model.views.design.document;
101 //TODO: Remove usage, seems as not needed 94 //TODO: Remove usage, seems as not needed
102 if (template && template.type === 'banner') { 95 if (template && template.type === 'banner') {
103 this.documentRoot = this.model.views.design.document.body.getElementsByTagName('ninja-banner')[0]; 96 this.documentRoot = this.model.views.design.document.body.getElementsByTagName('ninja-content')[0];
104 } else { 97 } else {
105 this.documentRoot = this.model.views.design.document.body; 98 this.documentRoot = this.model.views.design.document.body;
106 } 99 }
107 //TODO: Why is this needed? 100 //TODO: Why is this needed?
108 this._liveNodeList = this.model.views.design.document.body.getElementsByTagName('*'); 101 this._liveNodeList = this.documentRoot.getElementsByTagName('*');
109 //Initiliazing document model 102 //Initiliazing document model
110 document.application.njUtils.makeElementModel(this.model.views.design.document.body, "Body", "body"); 103 document.application.njUtils.makeElementModel(this.documentRoot, "Body", "body");
111 //Adding observer to know when template is ready 104 //Adding observer to know when template is ready
112 this._observer = new WebKitMutationObserver(this.handleTemplateReady.bind(this)); 105 this._observer = new WebKitMutationObserver(this.handleTemplateReady.bind(this));
113 this._observer.observe(this.model.views.design.document.head, {childList: true}); 106 this._observer.observe(this.model.views.design.document.head, {childList: true});
@@ -133,21 +126,10 @@ exports.HtmlDocument = Montage.create(Component, {
133 //////////////////////////////////////////////////////////////////// 126 ////////////////////////////////////////////////////////////////////
134 // 127 //
135 closeDocument: { 128 closeDocument: {
136 value: function () { 129 value: function (context, callback) {
137 // 130 var closed = this.model.close(null);
138 this.model.close(null, this.handleCloseDocument.bind(this)); 131
139 } 132 callback.call(context, this);
140 },
141 ////////////////////////////////////////////////////////////////////
142 //
143 handleCloseDocument: {
144 value: function (success) {
145 //TODO: Add logic for handling success or failure
146 //
147 this.application.ninja.documentController._documents.splice(this.uuid, 1);
148 //
149 NJevent("closeDocument", this.model.file.uri);
150 //TODO: Delete object here
151 } 133 }
152 }, 134 },
153 //////////////////////////////////////////////////////////////////// 135 ////////////////////////////////////////////////////////////////////