aboutsummaryrefslogtreecommitdiff
path: root/js/code-editor/ui/code-editor-view-options.reel/code-editor-view-options.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/code-editor/ui/code-editor-view-options.reel/code-editor-view-options.js')
-rw-r--r--js/code-editor/ui/code-editor-view-options.reel/code-editor-view-options.js61
1 files changed, 50 insertions, 11 deletions
diff --git a/js/code-editor/ui/code-editor-view-options.reel/code-editor-view-options.js b/js/code-editor/ui/code-editor-view-options.reel/code-editor-view-options.js
index 13c9a705..6c983867 100644
--- a/js/code-editor/ui/code-editor-view-options.reel/code-editor-view-options.js
+++ b/js/code-editor/ui/code-editor-view-options.reel/code-editor-view-options.js
@@ -36,6 +36,21 @@ exports.CodeEditorViewOptions = Montage.create(Component, {
36 } 36 }
37 }, 37 },
38 38
39 _codeEditorWrapper:{
40 value: null
41 },
42
43 codeEditorWrapper:{
44 get : function() {
45 return this._codeEditorWrapper;
46 },
47 set : function(value) {
48 if(this._codeEditorWrapper !== value){
49 this._codeEditorWrapper = value;
50 }
51 }
52 },
53
39 _visible: { 54 _visible: {
40 value: false 55 value: false
41 }, 56 },
@@ -97,6 +112,35 @@ exports.CodeEditorViewOptions = Montage.create(Component, {
97 serializable: true 112 serializable: true
98 }, 113 },
99 114
115 _zoomFactor:{
116 value: 100
117 },
118
119 zoomFactor:{
120 get: function(){
121 return this._zoomFactor;
122 },
123 set: function(value){
124 this._zoomFactor = value;
125 if(this.codeEditorWrapper){this.codeEditorWrapper.handleZoom(value)};
126 }
127 },
128
129 _automaticCodeHint:{
130 value: false
131 },
132
133 automaticCodeHint:{
134 get: function(){
135 return this._automaticCodeHint;
136 },
137 set: function(value){
138 this._automaticCodeHint = value;
139 //additing additional meta properties on the editor
140 this._currentDocument.model.views.code.editor.automaticCodeHint = value;
141 }
142 },
143
100 themeSelect: { 144 themeSelect: {
101 value: null, 145 value: null,
102 serializable: true 146 serializable: true
@@ -114,13 +158,6 @@ exports.CodeEditorViewOptions = Montage.create(Component, {
114 this.uncomment.addEventListener("click", this.handleUncomment.bind(this), false); 158 this.uncomment.addEventListener("click", this.handleUncomment.bind(this), false);
115 this.themeSelect.addEventListener("change", this.handleThemeSelection.bind(this), false); 159 this.themeSelect.addEventListener("change", this.handleThemeSelection.bind(this), false);
116 this.shortKeys.addEventListener("click", this.handleShortKeys.bind(this), false); 160 this.shortKeys.addEventListener("click", this.handleShortKeys.bind(this), false);
117
118 Object.defineBinding(this.zoomHottext , "value", {
119 boundObject: this.application.ninja.codeEditorController,
120 boundObjectPropertyPath: "zoomFactor",
121 oneway : false
122 });
123
124 } 161 }
125 }, 162 },
126 163
@@ -155,20 +192,22 @@ exports.CodeEditorViewOptions = Montage.create(Component, {
155 192
156 handleComment:{ 193 handleComment:{
157 value: function(evt){ 194 value: function(evt){
158 this.application.ninja.codeEditorController.commentSelection(true); 195 if(this.codeEditorWrapper){this.codeEditorWrapper.commentSelection(true)};
159 } 196 }
160 }, 197 },
161 198
162 handleUncomment:{ 199 handleUncomment:{
163 value: function(evt){ 200 value: function(evt){
164 this.application.ninja.codeEditorController.commentSelection(false); 201 if(this.codeEditorWrapper){this.codeEditorWrapper.commentSelection(false)};
165 } 202 }
166 }, 203 },
167 204
168 handleThemeSelection:{ 205 handleThemeSelection:{
169 value: function(evt){ 206 value: function(evt){
170 this.application.ninja.codeEditorController.editorTheme = this.themeSelect.options[this.themeSelect.selectedIndex].value; 207 if(this.codeEditorWrapper){
171 this.application.ninja.codeEditorController.handleThemeSelection(); 208 this.codeEditorWrapper.editorTheme = this.themeSelect.options[this.themeSelect.selectedIndex].value;
209 this.codeEditorWrapper.handleThemeSelection();
210 }
172 } 211 }
173 }, 212 },
174 213