diff options
author | Armen Kesablyan | 2012-03-07 16:08:36 -0800 |
---|---|---|
committer | Armen Kesablyan | 2012-03-07 16:08:36 -0800 |
commit | 84931583f1da8da29784074978f146b281b8efa3 (patch) | |
tree | c51673830f797d760a2e6b4b89f1216cea143b03 /js/panels/PanelContainer.reel | |
parent | d18d91946627c53c646a6f167855551a1891f8f4 (diff) | |
download | ninja-84931583f1da8da29784074978f146b281b8efa3.tar.gz |
Disabled state for panels
Signed-off-by: Armen Kesablyan <armen@motorola.com>
Diffstat (limited to 'js/panels/PanelContainer.reel')
-rwxr-xr-x | js/panels/PanelContainer.reel/PanelContainer.js | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/js/panels/PanelContainer.reel/PanelContainer.js b/js/panels/PanelContainer.reel/PanelContainer.js index b285b49d..c40bbc21 100755 --- a/js/panels/PanelContainer.reel/PanelContainer.js +++ b/js/panels/PanelContainer.reel/PanelContainer.js | |||
@@ -47,7 +47,7 @@ exports.PanelContainer = Montage.create(Component, { | |||
47 | this['panel_'+i].flexible = p.flexible; | 47 | this['panel_'+i].flexible = p.flexible; |
48 | this['panel_'+i].modulePath = p.modulePath; | 48 | this['panel_'+i].modulePath = p.modulePath; |
49 | this['panel_'+i].moduleName = p.moduleName; | 49 | this['panel_'+i].moduleName = p.moduleName; |
50 | this['panel_'+i].index = i; | 50 | this['panel_'+i].disabled = true; |
51 | 51 | ||
52 | this.currentPanelState[p.name] = {}; | 52 | this.currentPanelState[p.name] = {}; |
53 | this.currentPanelState.version = "1.0"; | 53 | this.currentPanelState.version = "1.0"; |
@@ -65,6 +65,8 @@ exports.PanelContainer = Montage.create(Component, { | |||
65 | this.application.localStorage.setItem("panels", this.currentPanelState); | 65 | this.application.localStorage.setItem("panels", this.currentPanelState); |
66 | 66 | ||
67 | 67 | ||
68 | this.eventManager.addEventListener( "onOpenDocument", this, false); | ||
69 | this.eventManager.addEventListener( "closeDocument", this, false); | ||
68 | } | 70 | } |
69 | }, | 71 | }, |
70 | 72 | ||
@@ -85,6 +87,24 @@ exports.PanelContainer = Montage.create(Component, { | |||
85 | this._redrawPanels(null, true); | 87 | this._redrawPanels(null, true); |
86 | } | 88 | } |
87 | }, | 89 | }, |
90 | |||
91 | handleOnOpenDocument: { | ||
92 | value: function(){ | ||
93 | this.panels.forEach(function(obj) { | ||
94 | obj.disabled = false; | ||
95 | }); | ||
96 | } | ||
97 | }, | ||
98 | |||
99 | handleCloseDocument: { | ||
100 | value: function(){ | ||
101 | if(!this.application.ninja.documentController.activeDocument) { | ||
102 | this.panels.forEach(function(obj) { | ||
103 | obj.disabled = true; | ||
104 | }); | ||
105 | } | ||
106 | } | ||
107 | }, | ||
88 | 108 | ||
89 | handleDropped: { | 109 | handleDropped: { |
90 | value: function(e) { | 110 | value: function(e) { |