diff options
Diffstat (limited to 'js/panels/PanelContainer.reel/PanelContainer.js')
-rwxr-xr-x | js/panels/PanelContainer.reel/PanelContainer.js | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/js/panels/PanelContainer.reel/PanelContainer.js b/js/panels/PanelContainer.reel/PanelContainer.js index 8d1d6a5e..b4f77317 100755 --- a/js/panels/PanelContainer.reel/PanelContainer.js +++ b/js/panels/PanelContainer.reel/PanelContainer.js | |||
@@ -21,6 +21,18 @@ exports.PanelContainer = Montage.create(Component, { | |||
21 | value: [] | 21 | value: [] |
22 | }, | 22 | }, |
23 | 23 | ||
24 | panelsAvailable: { | ||
25 | value: function() { | ||
26 | var pAvail = []; | ||
27 | this.panels.forEach(function(obj) { | ||
28 | if (window.getComputedStyle(obj.element).display !== "none") { | ||
29 | pAvail.push(obj); | ||
30 | } | ||
31 | }); | ||
32 | return pAvail; | ||
33 | } | ||
34 | }, | ||
35 | |||
24 | currentPanelState: { | 36 | currentPanelState: { |
25 | value: {} | 37 | value: {} |
26 | }, | 38 | }, |
@@ -49,6 +61,8 @@ exports.PanelContainer = Montage.create(Component, { | |||
49 | this['panel_'+i].modulePath = p.modulePath; | 61 | this['panel_'+i].modulePath = p.modulePath; |
50 | this['panel_'+i].moduleName = p.moduleName; | 62 | this['panel_'+i].moduleName = p.moduleName; |
51 | this['panel_'+i].disabled = true; | 63 | this['panel_'+i].disabled = true; |
64 | this['panel_'+i].groups = p.groups; | ||
65 | |||
52 | 66 | ||
53 | this.currentPanelState[p.name] = {}; | 67 | this.currentPanelState[p.name] = {}; |
54 | this.currentPanelState.version = "1.0"; | 68 | this.currentPanelState.version = "1.0"; |
@@ -144,15 +158,17 @@ exports.PanelContainer = Montage.create(Component, { | |||
144 | 158 | ||
145 | _setPanelsSizes: { | 159 | _setPanelsSizes: { |
146 | value: function(panelActivated) { | 160 | value: function(panelActivated) { |
147 | var len = this.panels.length, setLocked = true; | 161 | var availablePanels = this.panelsAvailable(); |
162 | var len = availablePanels.length; | ||
163 | var setLocked = true; | ||
148 | 164 | ||
149 | for(var i = 0; i < len; i++) { | 165 | for(var i = 0; i < len; i++) { |
150 | if(this.panels[i] === panelActivated || panelActivated === null) { | 166 | if(availablePanels[i] === panelActivated || panelActivated === null) { |
151 | setLocked = false; | 167 | setLocked = false; |
152 | } | 168 | } |
153 | 169 | ||
154 | this.panels[i].locked = setLocked; | 170 | availablePanels[i].locked = setLocked; |
155 | this.panels[i].needsDraw = true; | 171 | availablePanels[i].needsDraw = true; |
156 | } | 172 | } |
157 | } | 173 | } |
158 | }, | 174 | }, |
@@ -160,7 +176,8 @@ exports.PanelContainer = Montage.create(Component, { | |||
160 | _redrawPanels: { | 176 | _redrawPanels: { |
161 | value: function(panelActivated, unlockPanels) { | 177 | value: function(panelActivated, unlockPanels) { |
162 | var maxHeight = this.element.offsetHeight, setLocked = true; | 178 | var maxHeight = this.element.offsetHeight, setLocked = true; |
163 | var len = this.panels.length; | 179 | var availablePanels = this.panelsAvailable(); |
180 | var len = availablePanels.length; | ||
164 | 181 | ||
165 | if(unlockPanels === true) { | 182 | if(unlockPanels === true) { |
166 | setLocked = false; | 183 | setLocked = false; |
@@ -174,7 +191,7 @@ exports.PanelContainer = Montage.create(Component, { | |||
174 | } | 191 | } |
175 | 192 | ||
176 | for(var i = 0; i < len; i++) { | 193 | for(var i = 0; i < len; i++) { |
177 | var obj = this['panel_'+i]; | 194 | var obj = availablePanels[i]; |
178 | 195 | ||
179 | if(obj === panelActivated) { | 196 | if(obj === panelActivated) { |
180 | setLocked = false; | 197 | setLocked = false; |