diff options
author | Kruti Shah | 2012-06-12 13:09:11 -0700 |
---|---|---|
committer | Kruti Shah | 2012-06-12 13:09:11 -0700 |
commit | d648c842905c7c53e0f89b943982493d2b79f56e (patch) | |
tree | eb5585f92061975215f6d19305a8d1b76262e2fc /js/panels/properties.reel | |
parent | bedb38e14887b29eae3cdf1c8d435259c920257c (diff) | |
parent | cf3b96822665751dae7a64644db3cb3960733c3d (diff) | |
download | ninja-d648c842905c7c53e0f89b943982493d2b79f56e.tar.gz |
Merge branch 'refs/heads/TimelineUberjd' into TimelineUber
Conflicts:
js/controllers/elements/element-controller.js
js/document/_toDelete/html-document.js
js/panels/Timeline/Layer.reel/Layer.js
Signed-off-by: Kruti Shah <kruti.shah@motorola.com>
Diffstat (limited to 'js/panels/properties.reel')
4 files changed, 95 insertions, 75 deletions
diff --git a/js/panels/properties.reel/properties.html b/js/panels/properties.reel/properties.html index ac0dab5a..b9aa206b 100755 --- a/js/panels/properties.reel/properties.html +++ b/js/panels/properties.reel/properties.html | |||
@@ -56,7 +56,10 @@ | |||
56 | } | 56 | } |
57 | }, | 57 | }, |
58 | "threeDProperties": { | 58 | "threeDProperties": { |
59 | "prototype": "js/panels/properties.reel/sections/three-d-view.reel[ThreeD]" | 59 | "prototype": "js/panels/properties.reel/sections/three-d-view.reel[ThreeD]", |
60 | "bindings": { | ||
61 | "currentDocument": {"<-": "@owner.currentDocument"} | ||
62 | } | ||
60 | }, | 63 | }, |
61 | 64 | ||
62 | "CustomSections": { | 65 | "CustomSections": { |
diff --git a/js/panels/properties.reel/properties.js b/js/panels/properties.reel/properties.js index 7f8197ea..700b93f3 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 | ||
14 | exports.Properties = Montage.create(Component, { | 14 | exports.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 = ""; |
@@ -220,8 +244,8 @@ exports.Properties = Montage.create(Component, { | |||
220 | controls = this.customSections[n].content.controls; | 244 | controls = this.customSections[n].content.controls; |
221 | if(controls["colorSelect"]) { | 245 | if(controls["colorSelect"]) { |
222 | controls["colorSelect"].destroy(); | 246 | controls["colorSelect"].destroy(); |
223 | } else if(controls["background"]) { | 247 | } else if(controls["background-color"]) { |
224 | controls["background"].destroy(); | 248 | controls["background-color"].destroy(); |
225 | } | 249 | } |
226 | } | 250 | } |
227 | 251 | ||
diff --git a/js/panels/properties.reel/sections/custom.reel/custom.js b/js/panels/properties.reel/sections/custom.reel/custom.js index ae408f11..9df16112 100755 --- a/js/panels/properties.reel/sections/custom.reel/custom.js +++ b/js/panels/properties.reel/sections/custom.reel/custom.js | |||
@@ -400,7 +400,7 @@ exports.CustomSection = Montage.create(Component, { | |||
400 | this.controls[aField.id] = obj; | 400 | this.controls[aField.id] = obj; |
401 | 401 | ||
402 | // TODO - Hack for now to reference the color select object to unregister color chips | 402 | // TODO - Hack for now to reference the color select object to unregister color chips |
403 | this.controls["background"] = obj; | 403 | this.controls["background-color"] = obj; |
404 | 404 | ||
405 | return obj; | 405 | return obj; |
406 | } | 406 | } |
diff --git a/js/panels/properties.reel/sections/three-d-view.reel/three-d-view.js b/js/panels/properties.reel/sections/three-d-view.reel/three-d-view.js index e16e3509..104d474d 100755 --- a/js/panels/properties.reel/sections/three-d-view.reel/three-d-view.js +++ b/js/panels/properties.reel/sections/three-d-view.reel/three-d-view.js | |||
@@ -26,8 +26,7 @@ exports.ThreeD = Montage.create(Component, { | |||
26 | set: function(value) { | 26 | set: function(value) { |
27 | this._axisMode = value; | 27 | this._axisMode = value; |
28 | 28 | ||
29 | if(value === 0) | 29 | if(value === 0) { |
30 | { | ||
31 | this.inGlobalMode = false; | 30 | this.inGlobalMode = false; |
32 | this.x3D = 0; | 31 | this.x3D = 0; |
33 | this.y3D = 0; | 32 | this.y3D = 0; |
@@ -36,13 +35,10 @@ exports.ThreeD = Montage.create(Component, { | |||
36 | this.xAngle = 0; | 35 | this.xAngle = 0; |
37 | this.yAngle = 0; | 36 | this.yAngle = 0; |
38 | this.zAngle = 0; | 37 | this.zAngle = 0; |
39 | } | 38 | } else { |
40 | else | ||
41 | { | ||
42 | this.inGlobalMode = true; | 39 | this.inGlobalMode = true; |
43 | var item = this.item; | 40 | var item = this.item; |
44 | if(item) | 41 | if(item) { |
45 | { | ||
46 | this.x3D = item.elementModel.props3D.x3D; | 42 | this.x3D = item.elementModel.props3D.x3D; |
47 | this.y3D = item.elementModel.props3D.y3D; | 43 | this.y3D = item.elementModel.props3D.y3D; |
48 | this.z3D = item.elementModel.props3D.z3D; | 44 | this.z3D = item.elementModel.props3D.z3D; |
@@ -114,8 +110,7 @@ exports.ThreeD = Montage.create(Component, { | |||
114 | handleAction: { | 110 | handleAction: { |
115 | value: function(event) { | 111 | value: function(event) { |
116 | if(event.currentTarget.identifier === "flatten") { | 112 | if(event.currentTarget.identifier === "flatten") { |
117 | this.application.ninja.elementMediator.setProperty([this.item], | 113 | this.application.ninja.elementMediator.setProperty([this.item], "-webkit-transform-style", |
118 | "-webkit-transform-style", | ||
119 | event.currentTarget.checked ? ["flat"] : ["preserve-3d"]); | 114 | event.currentTarget.checked ? ["flat"] : ["preserve-3d"]); |
120 | } | 115 | } |
121 | } | 116 | } |
@@ -127,11 +122,7 @@ exports.ThreeD = Montage.create(Component, { | |||
127 | return; | 122 | return; |
128 | } | 123 | } |
129 | 124 | ||
130 | this.apply3DProperties(event.currentTarget.identifier, | 125 | this.apply3DProperties(event.currentTarget.identifier, event.currentTarget, this.item, this.inGlobalMode, false); |
131 | event.currentTarget, | ||
132 | this.item, | ||
133 | this.inGlobalMode, | ||
134 | false); | ||
135 | 126 | ||
136 | this._curMat = null; | 127 | this._curMat = null; |