diff options
Diffstat (limited to 'js/components/layout/document-bar.reel/document-bar.js')
-rwxr-xr-x | js/components/layout/document-bar.reel/document-bar.js | 55 |
1 files changed, 49 insertions, 6 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 | }, |