aboutsummaryrefslogtreecommitdiff
path: root/js/panels/properties.reel/properties.js
diff options
context:
space:
mode:
authorJonathan Duran2012-06-05 08:42:53 -0700
committerJonathan Duran2012-06-05 08:42:53 -0700
commitbd2c28100f347afc10243c80b8a288746370eee2 (patch)
treedb507fe0fdbe8e6f98f7d0f022b29c8d5942b4f7 /js/panels/properties.reel/properties.js
parent121d0e616f48aa7cd048763554089c20a1883d7a (diff)
parentc1ec69879028220b0c3f11ad6e24035bf527802c (diff)
downloadninja-bd2c28100f347afc10243c80b8a288746370eee2.tar.gz
Merge branch 'refs/heads/NINJAmaster' into TimelineUber
Conflicts: js/controllers/elements/element-controller.js js/panels/Timeline/Layer.reel/Layer.js js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js Signed-off-by: Jonathan Duran <jduran@motorola.com>
Diffstat (limited to 'js/panels/properties.reel/properties.js')
-rwxr-xr-xjs/panels/properties.reel/properties.js64
1 files changed, 44 insertions, 20 deletions
diff --git a/js/panels/properties.reel/properties.js b/js/panels/properties.reel/properties.js
index 7f8197ea..d3362474 100755
--- a/js/panels/properties.reel/properties.js
+++ b/js/panels/properties.reel/properties.js
@@ -13,6 +13,35 @@ var ElementsMediator = require("js/mediators/element-mediator").ElementMediator;
13 13
14exports.Properties = Montage.create(Component, { 14exports.Properties = Montage.create(Component, {
15 15
16 _currentDocument: {
17 value : null
18 },
19
20 currentDocument : {
21 get : function() {
22 return this._currentDocument;
23 },
24 set : function(value) {
25 if (value === this._currentDocument) {
26 return;
27 }
28
29 this._currentDocument = value;
30
31// if(!value) {
32 this.clear();
33// }
34
35 /*
36 else if(this._currentDocument.currentView === "design") {
37 // Display the default document root PI
38 //this.displayElementProperties(this._currentDocument.model.documentRoot);
39// this.displaySelection(this._currentDocument.model.selection);
40 }
41 */
42 }
43 },
44
16 elementName: { 45 elementName: {
17 value: null 46 value: null
18 }, 47 },
@@ -46,9 +75,8 @@ exports.Properties = Montage.create(Component, {
46 75
47 prepareForDraw: { 76 prepareForDraw: {
48 value : function() { 77 value : function() {
49 this.eventManager.addEventListener("openDocument", this, false); 78 this.eventManager.addEventListener("elementChange", this, false);
50 this.eventManager.addEventListener("selectionChange", this, false); 79 this.eventManager.addEventListener("selectionChange", this, false);
51 this.eventManager.addEventListener("closeDocument", this, false);
52 80
53 // This will be a toggle option 81 // This will be a toggle option
54 if(this.application.ninja.appData.PILiveUpdate) { 82 if(this.application.ninja.appData.PILiveUpdate) {
@@ -65,24 +93,6 @@ exports.Properties = Montage.create(Component, {
65 } 93 }
66 }, 94 },
67 95
68 handleOpenDocument: {
69 value: function() {
70 this.eventManager.addEventListener( "elementChange", this, false);
71
72 // Save a reference of the pi inside the document view to be able to clear
73 this.application.ninja.currentDocument.model.views.design.propertiesPanel = this;
74
75 // Display the default document root PI
76 this.displayElementProperties(this.application.ninja.currentDocument.model.documentRoot);
77 }
78 },
79
80 handleCloseDocument: {
81 value: function(){
82 this.clear();
83 }
84 },
85
86 /** 96 /**
87 * Blur and Key up to handle change in the Element ID field. 97 * Blur and Key up to handle change in the Element ID field.
88 */ 98 */
@@ -174,6 +184,20 @@ exports.Properties = Montage.create(Component, {
174 } 184 }
175 }, 185 },
176 186
187 displaySelection: {
188 value: function(selection) {
189 if(selection.length === 0) {
190 this.displayElementProperties(this._currentDocument.model.documentRoot);
191 } else {
192 if(selection.length === 1) {
193 this.displayElementProperties(this.application.ninja.selectedElements[0]);
194 } else {
195 this.displayGroupProperties(this.application.ninja.selectedElements);
196 }
197 }
198 }
199 },
200
177 clear: { 201 clear: {
178 value: function() { 202 value: function() {
179 this.elementName.value = ""; 203 this.elementName.value = "";