aboutsummaryrefslogtreecommitdiff
path: root/js/code-editor
diff options
context:
space:
mode:
authorAnanya Sen2012-07-25 12:28:58 -0700
committerAnanya Sen2012-07-25 12:28:58 -0700
commitfa2e82cf10aaa4900a462410cbb99b5b0433a1b1 (patch)
treeb7168d4dcd92a4d8a0692941b4688a92914bee51 /js/code-editor
parent0262cbeccef538d3aa125eb7cd16d8ca758c82b1 (diff)
downloadninja-fa2e82cf10aaa4900a462410cbb99b5b0433a1b1.tar.gz
fixing code editor double vertical scrollbar bug
Signed-off-by: Ananya Sen <Ananya.Sen@motorola.com> Conflicts: js/document/views/design-code.js Signed-off-by: Ananya Sen <Ananya.Sen@motorola.com>
Diffstat (limited to 'js/code-editor')
-rw-r--r--js/code-editor/ui/code-editor-view-options.reel/code-editor-view-options.html2
-rw-r--r--js/code-editor/ui/code-editor-view-options.reel/code-editor-view-options.js30
2 files changed, 24 insertions, 8 deletions
diff --git a/js/code-editor/ui/code-editor-view-options.reel/code-editor-view-options.html b/js/code-editor/ui/code-editor-view-options.reel/code-editor-view-options.html
index 476db181..e6cc3763 100644
--- a/js/code-editor/ui/code-editor-view-options.reel/code-editor-view-options.html
+++ b/js/code-editor/ui/code-editor-view-options.reel/code-editor-view-options.html
@@ -80,7 +80,7 @@ POSSIBILITY OF SUCH DAMAGE.
80<body> 80<body>
81<div data-montage-id="viewOptions" class="viewOptions"> 81<div data-montage-id="viewOptions" class="viewOptions">
82 <div> 82 <div>
83 <input class="zoomFont" data-montage-id="zoomFont"/> 83 <input class="zoomFont" data-montage-id="zoomFont" style="display:none;"/>
84 <div class="autoCodeComplete" > 84 <div class="autoCodeComplete" >
85 <input type="checkbox" data-montage-id="codeComplete" /> 85 <input type="checkbox" data-montage-id="codeComplete" />
86 <label data-montage-id="autoCompleteLabel">Auto Code Hints</label> 86 <label data-montage-id="autoCompleteLabel">Auto Code Hints</label>
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 5ad36db5..70d033fb 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
@@ -57,16 +57,25 @@ exports.CodeEditorViewOptions = Montage.create(Component, {
57 57
58 if(this._currentDocument.model.views.design){//code view of design document 58 if(this._currentDocument.model.views.design){//code view of design document
59 this.application.ninja.editorViewOptions.visible = false; 59 this.application.ninja.editorViewOptions.visible = false;
60 this.application.ninja.documentBar.codeEditorControls.visible = true; 60 //this.application.ninja.documentBar.codeEditorControls.visible = false;//todo
61 }else if(!this._currentDocument.model.views.design){//code view for text document 61 }else if(!this._currentDocument.model.views.design){//code view for text document
62 this.application.ninja.editorViewOptions.visible = true; 62 this.application.ninja.editorViewOptions.visible = true;
63 this.application.ninja.documentBar.codeEditorControls.visible = false; 63 //this.application.ninja.documentBar.codeEditorControls.visible = false;
64 } 64 }
65 65
66 this.autocomplete = !this.codeCompletionSupport[this._currentDocument.model.file.extension]; 66 this.autocomplete = !this.codeCompletionSupport[this._currentDocument.model.file.extension];
67 this._currentDocument.model.views.code.editor.automaticCodeHint = this.codeCompleteCheck.checked; 67 this._currentDocument.model.views.code.editor.automaticCodeHint = this.codeCompleteCheck.checked;
68 } 68 }
69 69
70 if(this._currentDocument && (this._currentDocument.currentView === "design")) {
71 this._currentDocument.addPropertyChangeListener("model.currentViewIdentifier", this, false);
72 }
73
74 //hide the zoom hottext if it is code view of a design file
75 if (this._currentDocument && this._currentDocument.model && this._currentDocument.model.views.code){
76 this.zoomHottext.element.style.display = "block";
77 }
78
70 } 79 }
71 }, 80 },
72 81
@@ -208,11 +217,6 @@ exports.CodeEditorViewOptions = Montage.create(Component, {
208 } else { 217 } else {
209 this.autoCompleteLabel.classList.remove("disabled"); 218 this.autoCompleteLabel.classList.remove("disabled");
210 } 219 }
211
212 //hide the zoom hottext if it is code view of a design file
213 if (this._currentDocument && this._currentDocument.model && this._currentDocument.model.views.design){
214 this.zoomHottext.element.style.display = "none";
215 }
216 } 220 }
217 }, 221 },
218 222
@@ -222,6 +226,18 @@ exports.CodeEditorViewOptions = Montage.create(Component, {
222 } 226 }
223 }, 227 },
224 228
229 handleChange: {
230 value: function(notification) {
231 if(notification.currentPropertyPath === "model.currentViewIdentifier") {
232 if(this.currentDocument.model.currentView.identifier === "design-code") {
233 //this.application.ninja.documentBar.codeEditorControls.visible = false;//todo
234 } else {
235 //this.application.ninja.documentBar.codeEditorControls.visible = false;
236 }
237 }
238 }
239 },
240
225 handleFormat:{ 241 handleFormat:{
226 value: function(evt){ 242 value: function(evt){
227 var range = this.getSelectedRange(this.currentDocument.model.views.code.editor); 243 var range = this.getSelectedRange(this.currentDocument.model.views.code.editor);