diff options
Diffstat (limited to 'js/panels/PanelContainer.reel/PanelContainer.js')
-rwxr-xr-x | js/panels/PanelContainer.reel/PanelContainer.js | 41 |
1 files changed, 18 insertions, 23 deletions
diff --git a/js/panels/PanelContainer.reel/PanelContainer.js b/js/panels/PanelContainer.reel/PanelContainer.js index 8d1d6a5e..7cb03255 100755 --- a/js/panels/PanelContainer.reel/PanelContainer.js +++ b/js/panels/PanelContainer.reel/PanelContainer.js | |||
@@ -16,7 +16,24 @@ exports.PanelContainer = Montage.create(Component, { | |||
16 | value: null | 16 | value: null |
17 | }, | 17 | }, |
18 | 18 | ||
19 | // This will hold the current loaded panels. | 19 | _currentDocument: { |
20 | value : null, | ||
21 | enumerable : false | ||
22 | }, | ||
23 | |||
24 | currentDocument : { | ||
25 | get : function() { | ||
26 | return this._currentDocument; | ||
27 | }, | ||
28 | set : function(value) { | ||
29 | if (value === this._currentDocument) { | ||
30 | return; | ||
31 | } | ||
32 | |||
33 | this._currentDocument = value; | ||
34 | } | ||
35 | }, | ||
36 | |||
20 | panels: { | 37 | panels: { |
21 | value: [] | 38 | value: [] |
22 | }, | 39 | }, |
@@ -64,10 +81,6 @@ exports.PanelContainer = Montage.create(Component, { | |||
64 | } | 81 | } |
65 | 82 | ||
66 | this.application.localStorage.setItem("panels", this.currentPanelState); | 83 | this.application.localStorage.setItem("panels", this.currentPanelState); |
67 | |||
68 | |||
69 | this.eventManager.addEventListener( "onOpenDocument", this, false); | ||
70 | this.eventManager.addEventListener( "closeDocument", this, false); | ||
71 | } | 84 | } |
72 | }, | 85 | }, |
73 | 86 | ||
@@ -89,24 +102,6 @@ exports.PanelContainer = Montage.create(Component, { | |||
89 | } | 102 | } |
90 | }, | 103 | }, |
91 | 104 | ||
92 | handleOnOpenDocument: { | ||
93 | value: function(){ | ||
94 | this.panels.forEach(function(obj) { | ||
95 | obj.disabled = false; | ||
96 | }); | ||
97 | } | ||
98 | }, | ||
99 | |||
100 | handleCloseDocument: { | ||
101 | value: function(){ | ||
102 | if(!this.application.ninja.documentController.activeDocument) { | ||
103 | this.panels.forEach(function(obj) { | ||
104 | obj.disabled = true; | ||
105 | }); | ||
106 | } | ||
107 | } | ||
108 | }, | ||
109 | |||
110 | handleDropped: { | 105 | handleDropped: { |
111 | value: function(e) { | 106 | value: function(e) { |
112 | var draggedIndex, droppedIndex = 0, len = this.panels.length; | 107 | var draggedIndex, droppedIndex = 0, len = this.panels.length; |