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 7cb03255..82069146 100755 --- a/js/panels/PanelContainer.reel/PanelContainer.js +++ b/js/panels/PanelContainer.reel/PanelContainer.js | |||
@@ -38,6 +38,18 @@ exports.PanelContainer = Montage.create(Component, { | |||
38 | value: [] | 38 | value: [] |
39 | }, | 39 | }, |
40 | 40 | ||
41 | panelsAvailable: { | ||
42 | value: function() { | ||
43 | var pAvail = []; | ||
44 | this.panels.forEach(function(obj) { | ||
45 | if (window.getComputedStyle(obj.element).display !== "none") { | ||
46 | pAvail.push(obj); | ||
47 | } | ||
48 | }); | ||
49 | return pAvail; | ||
50 | } | ||
51 | }, | ||
52 | |||
41 | currentPanelState: { | 53 | currentPanelState: { |
42 | value: {} | 54 | value: {} |
43 | }, | 55 | }, |
@@ -66,6 +78,8 @@ exports.PanelContainer = Montage.create(Component, { | |||
66 | this['panel_'+i].modulePath = p.modulePath; | 78 | this['panel_'+i].modulePath = p.modulePath; |
67 | this['panel_'+i].moduleName = p.moduleName; | 79 | this['panel_'+i].moduleName = p.moduleName; |
68 | this['panel_'+i].disabled = true; | 80 | this['panel_'+i].disabled = true; |
81 | this['panel_'+i].groups = p.groups; | ||
82 | |||
69 | 83 | ||
70 | this.currentPanelState[p.name] = {}; | 84 | this.currentPanelState[p.name] = {}; |
71 | this.currentPanelState.version = "1.0"; | 85 | this.currentPanelState.version = "1.0"; |
@@ -139,15 +153,17 @@ exports.PanelContainer = Montage.create(Component, { | |||
139 | 153 | ||
140 | _setPanelsSizes: { | 154 | _setPanelsSizes: { |
141 | value: function(panelActivated) { | 155 | value: function(panelActivated) { |
142 | var len = this.panels.length, setLocked = true; | 156 | var availablePanels = this.panelsAvailable(); |
157 | var len = availablePanels.length; | ||
158 | var setLocked = true; | ||
143 | 159 | ||
144 | for(var i = 0; i < len; i++) { | 160 | for(var i = 0; i < len; i++) { |
145 | if(this.panels[i] === panelActivated || panelActivated === null) { | 161 | if(availablePanels[i] === panelActivated || panelActivated === null) { |
146 | setLocked = false; | 162 | setLocked = false; |
147 | } | 163 | } |
148 | 164 | ||
149 | this.panels[i].locked = setLocked; | 165 | availablePanels[i].locked = setLocked; |
150 | this.panels[i].needsDraw = true; | 166 | availablePanels[i].needsDraw = true; |
151 | } | 167 | } |
152 | } | 168 | } |
153 | }, | 169 | }, |
@@ -155,7 +171,8 @@ exports.PanelContainer = Montage.create(Component, { | |||
155 | _redrawPanels: { | 171 | _redrawPanels: { |
156 | value: function(panelActivated, unlockPanels) { | 172 | value: function(panelActivated, unlockPanels) { |
157 | var maxHeight = this.element.offsetHeight, setLocked = true; | 173 | var maxHeight = this.element.offsetHeight, setLocked = true; |
158 | var len = this.panels.length; | 174 | var availablePanels = this.panelsAvailable(); |
175 | var len = availablePanels.length; | ||
159 | 176 | ||
160 | if(unlockPanels === true) { | 177 | if(unlockPanels === true) { |
161 | setLocked = false; | 178 | setLocked = false; |
@@ -169,7 +186,7 @@ exports.PanelContainer = Montage.create(Component, { | |||
169 | } | 186 | } |
170 | 187 | ||
171 | for(var i = 0; i < len; i++) { | 188 | for(var i = 0; i < len; i++) { |
172 | var obj = this['panel_'+i]; | 189 | var obj = availablePanels[i]; |
173 | 190 | ||
174 | if(obj === panelActivated) { | 191 | if(obj === panelActivated) { |
175 | setLocked = false; | 192 | setLocked = false; |