aboutsummaryrefslogtreecommitdiff
path: root/js/panels/PanelContainer.reel/PanelContainer.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/panels/PanelContainer.reel/PanelContainer.js')
-rwxr-xr-xjs/panels/PanelContainer.reel/PanelContainer.js29
1 files changed, 23 insertions, 6 deletions
diff --git a/js/panels/PanelContainer.reel/PanelContainer.js b/js/panels/PanelContainer.reel/PanelContainer.js
index 5c733b92..e0e547f9 100755
--- a/js/panels/PanelContainer.reel/PanelContainer.js
+++ b/js/panels/PanelContainer.reel/PanelContainer.js
@@ -84,6 +84,18 @@ exports.PanelContainer = Montage.create(Component, {
84 value: [] 84 value: []
85 }, 85 },
86 86
87 panelsAvailable: {
88 value: function() {
89 var pAvail = [];
90 this.panels.forEach(function(obj) {
91 if (window.getComputedStyle(obj.element).display !== "none") {
92 pAvail.push(obj);
93 }
94 });
95 return pAvail;
96 }
97 },
98
87 currentPanelState: { 99 currentPanelState: {
88 value: {} 100 value: {}
89 }, 101 },
@@ -112,6 +124,8 @@ exports.PanelContainer = Montage.create(Component, {
112 this['panel_'+i].modulePath = p.modulePath; 124 this['panel_'+i].modulePath = p.modulePath;
113 this['panel_'+i].moduleName = p.moduleName; 125 this['panel_'+i].moduleName = p.moduleName;
114 this['panel_'+i].disabled = true; 126 this['panel_'+i].disabled = true;
127 this['panel_'+i].groups = p.groups;
128
115 129
116 this.currentPanelState[p.name] = {}; 130 this.currentPanelState[p.name] = {};
117 this.currentPanelState.version = "1.0"; 131 this.currentPanelState.version = "1.0";
@@ -185,15 +199,17 @@ exports.PanelContainer = Montage.create(Component, {
185 199
186 _setPanelsSizes: { 200 _setPanelsSizes: {
187 value: function(panelActivated) { 201 value: function(panelActivated) {
188 var len = this.panels.length, setLocked = true; 202 var availablePanels = this.panelsAvailable();
203 var len = availablePanels.length;
204 var setLocked = true;
189 205
190 for(var i = 0; i < len; i++) { 206 for(var i = 0; i < len; i++) {
191 if(this.panels[i] === panelActivated || panelActivated === null) { 207 if(availablePanels[i] === panelActivated || panelActivated === null) {
192 setLocked = false; 208 setLocked = false;
193 } 209 }
194 210
195 this.panels[i].locked = setLocked; 211 availablePanels[i].locked = setLocked;
196 this.panels[i].needsDraw = true; 212 availablePanels[i].needsDraw = true;
197 } 213 }
198 } 214 }
199 }, 215 },
@@ -201,7 +217,8 @@ exports.PanelContainer = Montage.create(Component, {
201 _redrawPanels: { 217 _redrawPanels: {
202 value: function(panelActivated, unlockPanels) { 218 value: function(panelActivated, unlockPanels) {
203 var maxHeight = this.element.offsetHeight, setLocked = true; 219 var maxHeight = this.element.offsetHeight, setLocked = true;
204 var len = this.panels.length; 220 var availablePanels = this.panelsAvailable();
221 var len = availablePanels.length;
205 222
206 if(unlockPanels === true) { 223 if(unlockPanels === true) {
207 setLocked = false; 224 setLocked = false;
@@ -215,7 +232,7 @@ exports.PanelContainer = Montage.create(Component, {
215 } 232 }
216 233
217 for(var i = 0; i < len; i++) { 234 for(var i = 0; i < len; i++) {
218 var obj = this['panel_'+i]; 235 var obj = availablePanels[i];
219 236
220 if(obj === panelActivated) { 237 if(obj === panelActivated) {
221 setLocked = false; 238 setLocked = false;