aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
Diffstat (limited to 'js')
-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
-rwxr-xr-xjs/components/layout/document-bar.reel/document-bar.html9
-rwxr-xr-xjs/components/layout/document-bar.reel/document-bar.js6
-rw-r--r--js/document/views/design-code.js4
-rwxr-xr-xjs/stage/stage.reel/stage.css6
6 files changed, 39 insertions, 18 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);
diff --git a/js/components/layout/document-bar.reel/document-bar.html b/js/components/layout/document-bar.reel/document-bar.html
index fb505a7c..f073b0e7 100755
--- a/js/components/layout/document-bar.reel/document-bar.html
+++ b/js/components/layout/document-bar.reel/document-bar.html
@@ -78,12 +78,6 @@ POSSIBILITY OF SUCH DAMAGE.
78 } 78 }
79 }, 79 },
80 80
81 "codeEditorControls":{
82 "prototype": "js/code-editor/ui/code-editor-view-options.reel",
83 "properties": {
84 "element": {"#": "codeViewOptions"}
85 }
86 },
87 81
88 "owner": { 82 "owner": {
89 "prototype": "js/components/layout/document-bar.reel", 83 "prototype": "js/components/layout/document-bar.reel",
@@ -92,8 +86,7 @@ POSSIBILITY OF SUCH DAMAGE.
92 "zoomControl": {"@": "hottext1"}, 86 "zoomControl": {"@": "hottext1"},
93 "btnDesign": {"#": "buttonDesign"}, 87 "btnDesign": {"#": "buttonDesign"},
94 "btnCode": {"#": "buttonCode"}, 88 "btnCode": {"#": "buttonCode"},
95 "btnPreview": {"#": "buttonPreview"}, 89 "btnPreview": {"#": "buttonPreview"}
96 "codeEditorControls": {"@": "codeEditorControls"}
97 } 90 }
98 } 91 }
99 } 92 }
diff --git a/js/components/layout/document-bar.reel/document-bar.js b/js/components/layout/document-bar.reel/document-bar.js
index bf84c652..c1d77668 100755
--- a/js/components/layout/document-bar.reel/document-bar.js
+++ b/js/components/layout/document-bar.reel/document-bar.js
@@ -217,6 +217,9 @@ exports.DocumentBar = Montage.create(Component, {
217 value: function () { 217 value: function () {
218 // 218 //
219 this.showView('design', this.renderDesignView, this.btnDesign, this.btnCode); 219 this.showView('design', this.renderDesignView, this.btnDesign, this.btnCode);
220
221 //todo - temp
222 this.application.ninja.documentBar.codeEditorControls.visible = false;
220 } 223 }
221 }, 224 },
222 //////////////////////////////////////////////////////////////////// 225 ////////////////////////////////////////////////////////////////////
@@ -225,6 +228,9 @@ exports.DocumentBar = Montage.create(Component, {
225 value: function () { 228 value: function () {
226 // 229 //
227 this.showView('code', this.renderCodeView, this.btnCode, this.btnDesign); 230 this.showView('code', this.renderCodeView, this.btnCode, this.btnDesign);
231
232 //todo - temp
233 this.application.ninja.documentBar.codeEditorControls.visible = true;
228 } 234 }
229 }, 235 },
230 //////////////////////////////////////////////////////////////////// 236 ////////////////////////////////////////////////////////////////////
diff --git a/js/document/views/design-code.js b/js/document/views/design-code.js
index 70afe785..bf6e186f 100644
--- a/js/document/views/design-code.js
+++ b/js/document/views/design-code.js
@@ -72,7 +72,9 @@ exports.DesignCodeView = Montage.create(CodeDocumentView, {
72 value: function (callback) { 72 value: function (callback) {
73 this.textViewContainer.setAttribute("class", "codeViewContainer cm-s-default"); 73 this.textViewContainer.setAttribute("class", "codeViewContainer cm-s-default");
74 74
75 //todo : update options bar 75 this.textViewContainer.style.display = "block";
76
77 //todo : update options bar
76 78
77 // 79 //
78 if (callback) callback(); 80 if (callback) callback();
diff --git a/js/stage/stage.reel/stage.css b/js/stage/stage.reel/stage.css
index 56b4c58c..d1277ef1 100755
--- a/js/stage/stage.reel/stage.css
+++ b/js/stage/stage.reel/stage.css
@@ -68,7 +68,11 @@ POSSIBILITY OF SUCH DAMAGE.
68 68
69.codeViewContainer .CodeMirror-scroll { 69.codeViewContainer .CodeMirror-scroll {
70 height: 100%; 70 height: 100%;
71 overflow: auto; 71 overflow-y: hidden;
72}
73
74.codeViewContainer .CodeMirror-scrollbar {
75 display:none;
72} 76}
73 77
74.codeViewContainer>div{ 78.codeViewContainer>div{