aboutsummaryrefslogtreecommitdiff
path: root/js/document
diff options
context:
space:
mode:
Diffstat (limited to 'js/document')
-rwxr-xr-xjs/document/document-text.js3
-rwxr-xr-xjs/document/models/text.js2
-rwxr-xr-xjs/document/views/code.js21
3 files changed, 6 insertions, 20 deletions
diff --git a/js/document/document-text.js b/js/document/document-text.js
index 09525f4e..bb63f5f8 100755
--- a/js/document/document-text.js
+++ b/js/document/document-text.js
@@ -31,7 +31,6 @@ exports.TextDocument = Montage.create(Component, {
31 enumerable: false, 31 enumerable: false,
32 value : function(file, context, callback, view){ 32 value : function(file, context, callback, view){
33 var codeDocumentView = CodeDocumentView.create(), container = null; 33 var codeDocumentView = CodeDocumentView.create(), container = null;
34 codeDocumentView.initialize();
35 34
36 //Creating instance of Text Document Model 35 //Creating instance of Text Document Model
37 this.model = Montage.create(TextDocumentModel,{ 36 this.model = Montage.create(TextDocumentModel,{
@@ -40,6 +39,8 @@ exports.TextDocument = Montage.create(Component, {
40 views: {value: {'code': codeDocumentView, 'design': null}} 39 views: {value: {'code': codeDocumentView, 'design': null}}
41 }); 40 });
42 41
42 codeDocumentView.initialize(this.model.parentContainer);
43
43 codeDocumentView.textArea.value = file.content; 44 codeDocumentView.textArea.value = file.content;
44 codeDocumentView.initializeTextView(file, this); 45 codeDocumentView.initializeTextView(file, this);
45 46
diff --git a/js/document/models/text.js b/js/document/models/text.js
index d21666d0..fe02953c 100755
--- a/js/document/models/text.js
+++ b/js/document/models/text.js
@@ -59,7 +59,7 @@ exports.TextDocumentModel = Montage.create(BaseDocumentModel, {
59 success = true; 59 success = true;
60 } 60 }
61 // 61 //
62 this.views.code.textParentContainer.removeChild(this.views.code.textViewContainer); 62 this.parentContainer.removeChild(this.views.code.textViewContainer);
63 this.views.code.restoreAllPanels(); 63 this.views.code.restoreAllPanels();
64 this.views.code.showCodeViewBar(false); 64 this.views.code.showCodeViewBar(false);
65 this.views.code = null; 65 this.views.code = null;
diff --git a/js/document/views/code.js b/js/document/views/code.js
index de12881c..711479a8 100755
--- a/js/document/views/code.js
+++ b/js/document/views/code.js
@@ -41,18 +41,6 @@ var CodeDocumentView = exports.CodeDocumentView = Montage.create(BaseDocumentVie
41 get: function() {return this._textArea;}, 41 get: function() {return this._textArea;},
42 set: function(value) {this._textArea= value;} 42 set: function(value) {this._textArea= value;}
43 }, 43 },
44
45 ////////////////////////////////////////////////////////////////////
46 //remove _extParentContainer after moving to bucket structure for documents
47 _textParentContainer: {
48 value: null
49 },
50 ////////////////////////////////////////////////////////////////////
51 //
52 textParentContainer: {
53 get: function() {return this._textParentContainer;},
54 set: function(value) {this._textParentContainer= value;}
55 },
56 //////////////////////////////////////////////////////////////////// 44 ////////////////////////////////////////////////////////////////////
57 // 45 //
58 _textViewContainer: { 46 _textViewContainer: {
@@ -71,15 +59,12 @@ var CodeDocumentView = exports.CodeDocumentView = Montage.create(BaseDocumentVie
71 * Public method 59 * Public method
72 */ 60 */
73 initialize:{ 61 initialize:{
74 value: function(){ 62 value: function(parentContainer){
75 //populate _textParentContainer
76 this.textParentContainer = document.getElementById("codeViewContainer");
77
78 //create contianer 63 //create contianer
79 this.textViewContainer = document.createElement("div"); 64 this.textViewContainer = document.createElement("div");
80 //this.textViewContainer.id = "codemirror_" + uuid; 65 //this.textViewContainer.id = "codemirror_" + uuid;
81 this.textViewContainer.style.display = "block"; 66 this.textViewContainer.style.display = "block";
82 this.textParentContainer.appendChild(this.textViewContainer); 67 parentContainer.appendChild(this.textViewContainer);
83 68
84 //create text area 69 //create text area
85 this.textArea = this.createTextAreaElement(); 70 this.textArea = this.createTextAreaElement();
@@ -200,7 +185,7 @@ var CodeDocumentView = exports.CodeDocumentView = Montage.create(BaseDocumentVie
200 applyTheme:{ 185 applyTheme:{
201 value:function(themeClass){ 186 value:function(themeClass){
202 //Todo: change for bucket structure of documents 187 //Todo: change for bucket structure of documents
203 this.textParentContainer.className = "codeViewContainer "+themeClass; 188 this.textViewContainer.className = "codeViewContainer "+themeClass;
204 } 189 }
205 } 190 }
206 191