aboutsummaryrefslogtreecommitdiff
path: root/js/panels/PanelContainer.reel/PanelContainer.js
diff options
context:
space:
mode:
authorAnanya Sen2012-06-04 10:43:29 -0700
committerAnanya Sen2012-06-04 10:43:29 -0700
commit6fb29883329c9c42a8b406128b92c0e6323a47be (patch)
tree07f46e88bccf9cdb7d4e6818e1b646b0d19f05b9 /js/panels/PanelContainer.reel/PanelContainer.js
parentcf097ec69e35c07ecae5a105ed5eeb78291c9ac2 (diff)
parentc1ec69879028220b0c3f11ad6e24035bf527802c (diff)
downloadninja-6fb29883329c9c42a8b406128b92c0e6323a47be.tar.gz
Merge branch 'refs/heads/ninja-internal-master' into cut-copy-paste
Conflicts: js/ninja.reel/ninja.html Signed-off-by: Ananya Sen <Ananya.Sen@motorola.com>
Diffstat (limited to 'js/panels/PanelContainer.reel/PanelContainer.js')
-rwxr-xr-xjs/panels/PanelContainer.reel/PanelContainer.js41
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;