From c80e7df1702dff09b5cc8447ab0619747fed2024 Mon Sep 17 00:00:00 2001 From: Armen Kesablyan Date: Fri, 11 May 2012 15:03:10 -0700 Subject: created the initial environment requirements for workspace to be manipulated. Signed-off-by: Armen Kesablyan --- js/panels/PanelContainer.reel/PanelContainer.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'js/panels/PanelContainer.reel/PanelContainer.js') diff --git a/js/panels/PanelContainer.reel/PanelContainer.js b/js/panels/PanelContainer.reel/PanelContainer.js index 8d1d6a5e..044fd598 100755 --- a/js/panels/PanelContainer.reel/PanelContainer.js +++ b/js/panels/PanelContainer.reel/PanelContainer.js @@ -21,6 +21,18 @@ exports.PanelContainer = Montage.create(Component, { value: [] }, + panelsAvailable: { + value: function() { + var pAvail = []; + this.panels.forEach(function(obj) { + if (window.getComputedStyle(obj.element).display !== "none") { + pAvail.push(obj); + } + }); + return pAvail; + } + }, + currentPanelState: { value: {} }, @@ -49,6 +61,8 @@ exports.PanelContainer = Montage.create(Component, { this['panel_'+i].modulePath = p.modulePath; this['panel_'+i].moduleName = p.moduleName; this['panel_'+i].disabled = true; + this['panel_'+i].groups = p.groups; + this.currentPanelState[p.name] = {}; this.currentPanelState.version = "1.0"; @@ -144,6 +158,7 @@ exports.PanelContainer = Montage.create(Component, { _setPanelsSizes: { value: function(panelActivated) { + this.panelsAvailable(); var len = this.panels.length, setLocked = true; for(var i = 0; i < len; i++) { @@ -160,6 +175,7 @@ exports.PanelContainer = Montage.create(Component, { _redrawPanels: { value: function(panelActivated, unlockPanels) { var maxHeight = this.element.offsetHeight, setLocked = true; + var availablePanels = this.panelsAvailable(); var len = this.panels.length; if(unlockPanels === true) { -- cgit v1.2.3 From 336e0e0ef242f5c472757fe3bbcdd54c04a00f1f Mon Sep 17 00:00:00 2001 From: Armen Kesablyan Date: Mon, 14 May 2012 10:32:59 -0700 Subject: Workspace: has customized Signed-off-by: Armen Kesablyan --- js/panels/PanelContainer.reel/PanelContainer.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'js/panels/PanelContainer.reel/PanelContainer.js') diff --git a/js/panels/PanelContainer.reel/PanelContainer.js b/js/panels/PanelContainer.reel/PanelContainer.js index 044fd598..b4f77317 100755 --- a/js/panels/PanelContainer.reel/PanelContainer.js +++ b/js/panels/PanelContainer.reel/PanelContainer.js @@ -158,16 +158,17 @@ exports.PanelContainer = Montage.create(Component, { _setPanelsSizes: { value: function(panelActivated) { - this.panelsAvailable(); - var len = this.panels.length, setLocked = true; + var availablePanels = this.panelsAvailable(); + var len = availablePanels.length; + var setLocked = true; for(var i = 0; i < len; i++) { - if(this.panels[i] === panelActivated || panelActivated === null) { + if(availablePanels[i] === panelActivated || panelActivated === null) { setLocked = false; } - this.panels[i].locked = setLocked; - this.panels[i].needsDraw = true; + availablePanels[i].locked = setLocked; + availablePanels[i].needsDraw = true; } } }, @@ -176,7 +177,7 @@ exports.PanelContainer = Montage.create(Component, { value: function(panelActivated, unlockPanels) { var maxHeight = this.element.offsetHeight, setLocked = true; var availablePanels = this.panelsAvailable(); - var len = this.panels.length; + var len = availablePanels.length; if(unlockPanels === true) { setLocked = false; @@ -190,7 +191,7 @@ exports.PanelContainer = Montage.create(Component, { } for(var i = 0; i < len; i++) { - var obj = this['panel_'+i]; + var obj = availablePanels[i]; if(obj === panelActivated) { setLocked = false; -- cgit v1.2.3