diff options
author | Jose Antonio Marquez | 2012-02-10 16:24:36 -0800 |
---|---|---|
committer | Jose Antonio Marquez | 2012-02-10 16:24:36 -0800 |
commit | 5eb38b8bd779c7fb6e59b966135f8d306378f034 (patch) | |
tree | 0d6bd3358480426a4a6fb6ffe347711a04fe2ac6 | |
parent | daa1cb4327ed82e6784e3f1e1e159a9dcc094228 (diff) | |
download | ninja-5eb38b8bd779c7fb6e59b966135f8d306378f034.tar.gz |
Cleaning up open file in code view
-rwxr-xr-x | js/controllers/document-controller.js | 36 |
1 files changed, 1 insertions, 35 deletions
diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js index 7e2fb599..7f4feff9 100755 --- a/js/controllers/document-controller.js +++ b/js/controllers/document-controller.js | |||
@@ -181,45 +181,11 @@ DocumentController = exports.DocumentController = Montage.create(Component, { | |||
181 | var code = Montage.create(TextDocument, {"source": {value: doc.content}}), docuuid = Uuid.generate(), textArea; | 181 | var code = Montage.create(TextDocument, {"source": {value: doc.content}}), docuuid = Uuid.generate(), textArea; |
182 | textArea = this.application.ninja.stage.stageView.createTextAreaElement(docuuid); | 182 | textArea = this.application.ninja.stage.stageView.createTextAreaElement(docuuid); |
183 | code.initialize(doc, docuuid, textArea, textArea.parentNode); | 183 | code.initialize(doc, docuuid, textArea, textArea.parentNode); |
184 | code._documentType = doc.extension; | 184 | code.init(doc.name, doc.uri, doc.extension, null, docuuid); |
185 | code.textArea.value = doc.content; | 185 | code.textArea.value = doc.content; |
186 | this.application.ninja.stage.stageView.createTextView(code); | 186 | this.application.ninja.stage.stageView.createTextView(code); |
187 | break; | 187 | break; |
188 | } | 188 | } |
189 | |||
190 | return; | ||
191 | |||
192 | |||
193 | |||
194 | |||
195 | |||
196 | var newDoc; | ||
197 | |||
198 | if(!doc) return false; | ||
199 | |||
200 | // try { | ||
201 | if (doc.type === 'html' || doc.type === 'htm') { | ||
202 | console.log('hello'); | ||
203 | newDoc = Montage.create(HTMLDocument); | ||
204 | newDoc.initialize(doc, Uuid.generate(), this._createIframeElement(), this._onOpenDocument); | ||
205 | } else { | ||
206 | newDoc = Montage.create(TextDocument, { | ||
207 | "source": { value: doc.source } | ||
208 | }); | ||
209 | var docUuid = Uuid.generate(); | ||
210 | var textArea = this.application.ninja.stage.stageView.createTextAreaElement(docUuid); | ||
211 | newDoc.initialize(doc, docUuid, textArea, textArea.parentNode); | ||
212 | |||
213 | // Tmp this will be filled with the real content | ||
214 | newDoc.textArea.value = doc.source; //this.tmpSourceForTesting; | ||
215 | |||
216 | this.textDocumentOpened(newDoc); | ||
217 | |||
218 | } | ||
219 | |||
220 | // } catch (err) { | ||
221 | // console.log("Could not open Document ", err); | ||
222 | // } | ||
223 | } | 189 | } |
224 | }, | 190 | }, |
225 | //////////////////////////////////////////////////////////////////// | 191 | //////////////////////////////////////////////////////////////////// |