aboutsummaryrefslogtreecommitdiff
path: root/js/io/document/text-document.js
diff options
context:
space:
mode:
authorAnanya Sen2012-02-03 17:22:48 -0800
committerAnanya Sen2012-02-03 17:22:48 -0800
commit1daf146c849a0a8dbd2b61b14218c9a39bdee3a7 (patch)
treeaf5568f4adac1371ee8b533c34198fb72545e778 /js/io/document/text-document.js
parent7618cabe1945acc6392c48f3b57820f67f7973b0 (diff)
downloadninja-1daf146c849a0a8dbd2b61b14218c9a39bdee3a7.tar.gz
added editor tab save while switching code view tabs,
integrated new file dialog with io mediator to open the new file in a new tab Signed-off-by: Ananya Sen <Ananya.Sen@motorola.com>
Diffstat (limited to 'js/io/document/text-document.js')
-rwxr-xr-xjs/io/document/text-document.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/js/io/document/text-document.js b/js/io/document/text-document.js
index 156aaacb..a768779f 100755
--- a/js/io/document/text-document.js
+++ b/js/io/document/text-document.js
@@ -85,6 +85,22 @@ var TextDocument = exports.TextDocument = Montage.create(baseDocumentModule.Base
85 85
86 xhr.send(''); 86 xhr.send('');
87 } 87 }
88 },
89
90 /**
91 * public method
92 * parameter:
93 * removeCodeMirrorDivFlag - for code view, tell to remove the codemirror div after saving
94 */
95 save:{
96 value:function(removeCodeMirrorDivFlag){
97 this.editor.save();
98 if(removeCodeMirrorDivFlag === true){
99 var codemirrorDiv = this.textArea.parentNode.querySelector(".CodeMirror");
100 if(!!codemirrorDiv){codemirrorDiv.parentNode.removeChild(codemirrorDiv);}
101 }
102 //persist to filesystem
103 }
88 } 104 }
89 105
90}); \ No newline at end of file 106}); \ No newline at end of file