diff options
Diffstat (limited to 'js/panels/PanelContainer.reel/PanelContainer.js')
-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) { |