aboutsummaryrefslogtreecommitdiff
path: root/js/controllers
diff options
context:
space:
mode:
authorAnanya Sen2012-04-16 18:19:17 -0700
committerAnanya Sen2012-04-16 18:19:17 -0700
commit2449fc403e8a8a22f092c87e3268a69a2be67e43 (patch)
tree71d660356892f98ce7a694c942d3fe132f171ac1 /js/controllers
parentc2ec390d42945d2df1aed3f2b7ff3d1aa722fce8 (diff)
downloadninja-2449fc403e8a8a22f092c87e3268a69a2be67e43.tar.gz
Added comment and uncomment control in the editor view options
Signed-off-by: Ananya Sen <Ananya.Sen@motorola.com>
Diffstat (limited to 'js/controllers')
-rw-r--r--js/controllers/code-editor-controller.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/js/controllers/code-editor-controller.js b/js/controllers/code-editor-controller.js
index 534d4645..52eb47eb 100644
--- a/js/controllers/code-editor-controller.js
+++ b/js/controllers/code-editor-controller.js
@@ -162,5 +162,26 @@ var CodeEditorController = exports.CodeEditorController = Montage.create(Compone
162 autoCodeCompleteElem.style.visibility = "hidden"; 162 autoCodeCompleteElem.style.visibility = "hidden";
163 } 163 }
164 } 164 }
165 },
166
167 getSelectedRange:{
168 value:function(editor){
169 return { from: editor.getCursor(true), to: editor.getCursor(false) };
170 }
171 },
172
173 autoFormatSelection:{
174 value: function(){
175 var range = this.getSelectedRange(this.application.ninja.documentController.activeDocument.editor);
176 this.application.ninja.documentController.activeDocument.editor.autoFormatRange(range.from, range.to);
177 }
178 },
179
180 commentSelection:{
181 value: function(isComment){
182 var range = this.getSelectedRange(this.application.ninja.documentController.activeDocument.editor);
183 this.application.ninja.documentController.activeDocument.editor.commentRange(isComment, range.from, range.to);
184 }
165 } 185 }
186
166}); \ No newline at end of file 187}); \ No newline at end of file