aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xjs/panels/PanelContainer.reel/PanelContainer.js35
1 files changed, 19 insertions, 16 deletions
diff --git a/js/panels/PanelContainer.reel/PanelContainer.js b/js/panels/PanelContainer.reel/PanelContainer.js
index dd720bd3..8cc303dc 100755
--- a/js/panels/PanelContainer.reel/PanelContainer.js
+++ b/js/panels/PanelContainer.reel/PanelContainer.js
@@ -81,7 +81,7 @@ exports.PanelContainer = Montage.create(Component, {
81 81
82 handleResize: { 82 handleResize: {
83 value: function(e) { 83 value: function(e) {
84 this._setPanelsSizes(null); 84 this._redrawPanels(null, true);
85 } 85 }
86 }, 86 },
87 87
@@ -104,8 +104,6 @@ exports.PanelContainer = Montage.create(Component, {
104 // switch panels 104 // switch panels
105 this.panels[droppedIndex].element.parentNode.insertBefore(this.panels[draggedIndex].element, this.panels[droppedIndex].element); 105 this.panels[droppedIndex].element.parentNode.insertBefore(this.panels[draggedIndex].element, this.panels[droppedIndex].element);
106 } 106 }
107
108 this._setPanelsSizes(null);
109 } 107 }
110 }, 108 },
111 109
@@ -133,7 +131,10 @@ exports.PanelContainer = Montage.create(Component, {
133 setLocked = false; 131 setLocked = false;
134 } 132 }
135 133
136 var childrensMinHeights = ((len - 1) * 26) + panelActivated.minHeight; 134 var childrensMinHeights = (len * 26);
135 if (panelActivated) {
136 childrensMinHeights+= panelActivated.minHeight -26;
137 }
137 138
138 for(var i = 0; i < len; i++) { 139 for(var i = 0; i < len; i++) {
139 var obj = this['panel_'+i]; 140 var obj = this['panel_'+i];
@@ -169,25 +170,27 @@ exports.PanelContainer = Montage.create(Component, {
169 var unlockPanels = true; 170 var unlockPanels = true;
170 var afterPanel = false; 171 var afterPanel = false;
171 var panelName = e.target.parentComponent.name; 172 var panelName = e.target.parentComponent.name;
173
174 this.panels.forEach(function(obj) {
175 if(afterPanel) {
176 if(obj.flexible && obj.collapsed === false) {
177 unlockPanels = false;
178 }
179 }
180 if (obj.name === panelName) {
181 afterPanel = true;
182 }
183 });
184
172 switch(e.target.identifier) { 185 switch(e.target.identifier) {
173 case "btnCollapse": 186 case "btnCollapse":
174 this.currentPanelState[e.target.parentComponent.name].collapsed = e.target.parentComponent.collapsed; 187 this.currentPanelState[e.target.parentComponent.name].collapsed = e.target.parentComponent.collapsed;
175 this.application.localStorage.setItem("panels", this.currentPanelState); 188 this.application.localStorage.setItem("panels", this.currentPanelState);
176 this._setPanelsSizes(e.target.parentComponent); 189 //this._setPanelsSizes(e.target.parentComponent);
177 this._redrawPanels(e.target.parentComponent, unlockPanels); 190 this._redrawPanels(e.target.parentComponent, unlockPanels);
178 break; 191 break;
179 case "btnClose": 192 case "btnClose":
180 this.panelController.content.forEach(function(obj) { 193 //this.panelController.removeObjects(obj);
181 if(afterPanel) {
182 if(obj.flexible) {
183 unlockPanels = false;
184 }
185 }
186 if (obj.name === panelName) {
187 afterPanel = true;
188 this.panelController.removeObjects(obj);
189 }
190 });
191 this._redrawPanels(e.target.parentComponent, unlockPanels); 194 this._redrawPanels(e.target.parentComponent, unlockPanels);
192 break; 195 break;
193 } 196 }