diff options
-rwxr-xr-x | js/components/layout/document-bar.reel/document-bar.js | 55 | ||||
-rwxr-xr-x | js/document/models/text.js | 1 | ||||
-rwxr-xr-x | js/stage/stage.reel/stage.js | 13 |
3 files changed, 49 insertions, 20 deletions
diff --git a/js/components/layout/document-bar.reel/document-bar.js b/js/components/layout/document-bar.reel/document-bar.js index 90d3a207..1cb0bd90 100755 --- a/js/components/layout/document-bar.reel/document-bar.js +++ b/js/components/layout/document-bar.reel/document-bar.js | |||
@@ -28,13 +28,45 @@ exports.DocumentBar = Montage.create(Component, { | |||
28 | 28 | ||
29 | this.disabled = !this._currentDocument; | 29 | this.disabled = !this._currentDocument; |
30 | 30 | ||
31 | if(this._currentDocument && this._currentDocument.currentView === "design") { | ||
32 | this.visible = true; | ||
33 | } else if(this._currentDocument && this._currentDocument.currentView === "code") { | ||
34 | this.visible = false; | ||
35 | } | ||
31 | } | 36 | } |
32 | }, | 37 | }, |
33 | 38 | ||
34 | designView: { value: null, enumerable: false}, | 39 | _visible: { |
35 | codeView: { value: null, enumerable: false}, | 40 | value: false |
36 | zoomControl: { value: null, enumerable: false }, | 41 | }, |
37 | _type: { enumerable: false, value: null }, | 42 | |
43 | visible: { | ||
44 | get: function() { | ||
45 | return this._visible; | ||
46 | }, | ||
47 | set: function(value) { | ||
48 | if(this._visible !== value) { | ||
49 | this._visible = value; | ||
50 | this.needsDraw = true; | ||
51 | } | ||
52 | } | ||
53 | }, | ||
54 | |||
55 | designView: { | ||
56 | value: null | ||
57 | }, | ||
58 | |||
59 | codeView: { | ||
60 | value: null | ||
61 | }, | ||
62 | |||
63 | zoomControl: { | ||
64 | value: null | ||
65 | }, | ||
66 | |||
67 | _type: { | ||
68 | value: null | ||
69 | }, | ||
38 | 70 | ||
39 | type: { | 71 | type: { |
40 | enumerable: false, | 72 | enumerable: false, |
@@ -50,7 +82,9 @@ exports.DocumentBar = Montage.create(Component, { | |||
50 | } | 82 | } |
51 | }, | 83 | }, |
52 | 84 | ||
53 | _currentView: { value: null, enumerable: false }, | 85 | _currentView: { |
86 | value: null | ||
87 | }, | ||
54 | 88 | ||
55 | currentView: { | 89 | currentView: { |
56 | get: function() { return this._currentView}, | 90 | get: function() { return this._currentView}, |
@@ -64,7 +98,9 @@ exports.DocumentBar = Montage.create(Component, { | |||
64 | } | 98 | } |
65 | }, | 99 | }, |
66 | 100 | ||
67 | _zoomFactor: { value: 100, enumerable: false }, | 101 | _zoomFactor: { |
102 | value: 100 | ||
103 | }, | ||
68 | 104 | ||
69 | zoomFactor: { | 105 | zoomFactor: { |
70 | get: function() { return this._zoomFactor; }, | 106 | get: function() { return this._zoomFactor; }, |
@@ -84,6 +120,7 @@ exports.DocumentBar = Montage.create(Component, { | |||
84 | 120 | ||
85 | draw: { | 121 | draw: { |
86 | value: function() { | 122 | value: function() { |
123 | /* | ||
87 | if(this.type === "htm" || this.type === "html") { | 124 | if(this.type === "htm" || this.type === "html") { |
88 | this.designView.classList.add("active"); | 125 | this.designView.classList.add("active"); |
89 | this.codeView.classList.add("active"); | 126 | this.codeView.classList.add("active"); |
@@ -99,6 +136,12 @@ exports.DocumentBar = Montage.create(Component, { | |||
99 | } else if(this.type) { | 136 | } else if(this.type) { |
100 | this.designView.classList.remove("active"); | 137 | this.designView.classList.remove("active"); |
101 | } | 138 | } |
139 | */ | ||
140 | if(this.visible) { | ||
141 | this.element.style.display = "block"; | ||
142 | } else { | ||
143 | this.element.style.display = "none"; | ||
144 | } | ||
102 | 145 | ||
103 | } | 146 | } |
104 | }, | 147 | }, |
diff --git a/js/document/models/text.js b/js/document/models/text.js index 0135b9ba..6cb61d48 100755 --- a/js/document/models/text.js +++ b/js/document/models/text.js | |||
@@ -60,7 +60,6 @@ exports.TextDocumentModel = Montage.create(BaseDocumentModel, { | |||
60 | } | 60 | } |
61 | // | 61 | // |
62 | this.parentContainer.removeChild(this.views.code.textViewContainer); | 62 | this.parentContainer.removeChild(this.views.code.textViewContainer); |
63 | this.application.ninja.stage.showCodeViewBar(false); | ||
64 | this.application.ninja.stage.restoreAllPanels(); | 63 | this.application.ninja.stage.restoreAllPanels(); |
65 | this.views.code = null; | 64 | this.views.code = null; |
66 | 65 | ||
diff --git a/js/stage/stage.reel/stage.js b/js/stage/stage.reel/stage.js index ed716541..d8f7313b 100755 --- a/js/stage/stage.reel/stage.js +++ b/js/stage/stage.reel/stage.js | |||
@@ -192,7 +192,6 @@ exports.Stage = Montage.create(Component, { | |||
192 | drawUtils._eltArray.length = 0; | 192 | drawUtils._eltArray.length = 0; |
193 | drawUtils._planesArray.length = 0; | 193 | drawUtils._planesArray.length = 0; |
194 | } else if(this._currentDocument.currentView === "design") { | 194 | } else if(this._currentDocument.currentView === "design") { |
195 | this.showCodeViewBar(false); | ||
196 | this.restoreAllPanels(); | 195 | this.restoreAllPanels(); |
197 | this.hideCanvas(false); | 196 | this.hideCanvas(false); |
198 | this.showRulers(); | 197 | this.showRulers(); |
@@ -200,7 +199,6 @@ exports.Stage = Montage.create(Component, { | |||
200 | this.clearAllCanvas(); | 199 | this.clearAllCanvas(); |
201 | this.initWithDocument(); | 200 | this.initWithDocument(); |
202 | } else { | 201 | } else { |
203 | this.showCodeViewBar(true); | ||
204 | this.collapseAllPanels(); | 202 | this.collapseAllPanels(); |
205 | this.hideCanvas(true); | 203 | this.hideCanvas(true); |
206 | this.hideRulers(); | 204 | this.hideRulers(); |
@@ -1064,17 +1062,6 @@ exports.Stage = Montage.create(Component, { | |||
1064 | this.application.ninja.rulerLeft.style.display = "none"; | 1062 | this.application.ninja.rulerLeft.style.display = "none"; |
1065 | } | 1063 | } |
1066 | }, | 1064 | }, |
1067 | showCodeViewBar:{ | ||
1068 | value:function(isCodeView){ | ||
1069 | if(isCodeView === true) { | ||
1070 | |||
1071 | this.application.ninja.documentBar.element.style.display = "none"; | ||
1072 | } else { | ||
1073 | this.application.ninja.documentBar.element.style.display = "block"; | ||
1074 | |||
1075 | } | ||
1076 | } | ||
1077 | }, | ||
1078 | 1065 | ||
1079 | collapseAllPanels:{ | 1066 | collapseAllPanels:{ |
1080 | value:function(){ | 1067 | value:function(){ |