aboutsummaryrefslogtreecommitdiff
path: root/js/document/document-html.js
diff options
context:
space:
mode:
authorJose Antonio Marquez2012-05-10 14:54:38 -0700
committerJose Antonio Marquez2012-05-10 14:54:38 -0700
commitfb7a3aa9ce0d9b99dca79cfb89951b5c51523250 (patch)
tree3fdda43c5f4fc7d83bab9de16f5b02c1155aec20 /js/document/document-html.js
parent254e2f8ee3e915c7dafe445c724b88434fb52f28 (diff)
downloadninja-fb7a3aa9ce0d9b99dca79cfb89951b5c51523250.tar.gz
Adding partial close functionality
Diffstat (limited to 'js/document/document-html.js')
-rwxr-xr-xjs/document/document-html.js37
1 files changed, 36 insertions, 1 deletions
diff --git a/js/document/document-html.js b/js/document/document-html.js
index 567e4455..e00333f0 100755
--- a/js/document/document-html.js
+++ b/js/document/document-html.js
@@ -70,10 +70,11 @@ exports.HtmlDocument = Montage.create(Component, {
70 //Creating instance of HTML Document Model 70 //Creating instance of HTML Document Model
71 this.model = Montage.create(HtmlDocumentModel,{ 71 this.model = Montage.create(HtmlDocumentModel,{
72 file: {value: file}, 72 file: {value: file},
73 parentContainer: {value: document.getElementById("iframeContainer")}, //Saving reference to parent container of all views (should be changed to buckets approach
73 views: {value: {'design': DesignDocumentView.create(), 'code': null}} //TODO: Add code view logic 74 views: {value: {'design': DesignDocumentView.create(), 'code': null}} //TODO: Add code view logic
74 }); 75 });
75 //Initiliazing views and hiding 76 //Initiliazing views and hiding
76 if (this.model.views.design.initialize(document.getElementById("iframeContainer"))) { 77 if (this.model.views.design.initialize(this.model.parentContainer)) {
77 //Hiding iFrame, just initiliazing 78 //Hiding iFrame, just initiliazing
78 this.model.views.design.hide(); 79 this.model.views.design.hide();
79 } else { 80 } else {
@@ -123,6 +124,40 @@ exports.HtmlDocument = Montage.create(Component, {
123 //Setting opacity to be viewable after load 124 //Setting opacity to be viewable after load
124 this.model.views.design.iframe.style.opacity = 1; 125 this.model.views.design.iframe.style.opacity = 1;
125 } 126 }
127 },
128 ////////////////////////////////////////////////////////////////////
129 //
130 closeDocument: {
131 value: function () {
132 //
133 this.model.close(null, this.handleCloseDocument.bind(this));
134 }
135 },
136 ////////////////////////////////////////////////////////////////////
137 //
138 handleCloseDocument: {
139 value: function (success) {
140 //TODO: Add logic for handling success or failure
141 //
142 this.application.ninja.documentController._documents.splice(this.uuid, 1);
143 //
144 NJevent("closeDocument", this.model.file.uri);
145 //TODO: Delete object here
146 }
147 },
148 ////////////////////////////////////////////////////////////////////
149 //
150 saveAppState: {
151 value: function () {
152 //TODO: Import functionality
153 }
154 },
155 ////////////////////////////////////////////////////////////////////
156 //
157 restoreAppState: {
158 value: function () {
159 //TODO: Import functionality
160 }
126 } 161 }
127 //////////////////////////////////////////////////////////////////// 162 ////////////////////////////////////////////////////////////////////
128 //////////////////////////////////////////////////////////////////// 163 ////////////////////////////////////////////////////////////////////