diff options
author | Ananya Sen | 2012-04-17 18:10:39 -0700 |
---|---|---|
committer | Ananya Sen | 2012-04-17 18:10:39 -0700 |
commit | 1f891c58bad0b7746659aa4138001b5ee76d9a0e (patch) | |
tree | 758357769219036daed4797f6474b1a57063c410 /js/controllers | |
parent | 2449fc403e8a8a22f092c87e3268a69a2be67e43 (diff) | |
download | ninja-1f891c58bad0b7746659aa4138001b5ee76d9a0e.tar.gz |
added theme choices for editor
Signed-off-by: Ananya Sen <Ananya.Sen@motorola.com>
Diffstat (limited to 'js/controllers')
-rw-r--r-- | js/controllers/code-editor-controller.js | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/js/controllers/code-editor-controller.js b/js/controllers/code-editor-controller.js index 52eb47eb..cf0503a0 100644 --- a/js/controllers/code-editor-controller.js +++ b/js/controllers/code-editor-controller.js | |||
@@ -49,9 +49,13 @@ var CodeEditorController = exports.CodeEditorController = Montage.create(Compone | |||
49 | editorFont:{ | 49 | editorFont:{ |
50 | get: function(){return this._editorFont;}, | 50 | get: function(){return this._editorFont;}, |
51 | set: function(value){//gets a zoom % | 51 | set: function(value){//gets a zoom % |
52 | var codeLineElems = null, i=0; | ||
52 | this._editorFont = (value/100) * CodeEditorController.originalEditorFont; | 53 | this._editorFont = (value/100) * CodeEditorController.originalEditorFont; |
53 | //set the font size | 54 | //set the font size |
54 | document.getElementsByClassName("codeViewContainer")[0].style.fontSize = ""+this._editorFont+"px"; | 55 | codeLineElems = document.getElementsByClassName("CodeMirror-lines"); |
56 | for(i=0;i<codeLineElems.length;i++){ | ||
57 | codeLineElems[i].style.fontSize = ""+this._editorFont+"px"; | ||
58 | } | ||
55 | } | 59 | } |
56 | }, | 60 | }, |
57 | 61 | ||
@@ -182,6 +186,12 @@ var CodeEditorController = exports.CodeEditorController = Montage.create(Compone | |||
182 | var range = this.getSelectedRange(this.application.ninja.documentController.activeDocument.editor); | 186 | var range = this.getSelectedRange(this.application.ninja.documentController.activeDocument.editor); |
183 | this.application.ninja.documentController.activeDocument.editor.commentRange(isComment, range.from, range.to); | 187 | this.application.ninja.documentController.activeDocument.editor.commentRange(isComment, range.from, range.to); |
184 | } | 188 | } |
189 | }, | ||
190 | |||
191 | handleThemeSelection:{ | ||
192 | value: function(theme){ | ||
193 | this.application.ninja.documentController.activeDocument.editor.setOption("theme", theme); | ||
194 | } | ||
185 | } | 195 | } |
186 | 196 | ||
187 | }); \ No newline at end of file | 197 | }); \ No newline at end of file |