aboutsummaryrefslogtreecommitdiff
path: root/js/panels
diff options
context:
space:
mode:
authorValerio Virgillito2012-05-22 17:45:35 -0700
committerValerio Virgillito2012-05-22 17:45:35 -0700
commita341522e3603c18ab3b93defa894e3be702dd0f4 (patch)
tree1eea021b0720c3f42038cce585f3a856b8ba15ef /js/panels
parent2b207ef8b2594927f8cd6cd63a8483d205cb86c4 (diff)
downloadninja-a341522e3603c18ab3b93defa894e3be702dd0f4.tar.gz
fixing the undefined 'color' issue
Signed-off-by: Valerio Virgillito <valerio@motorola.com>
Diffstat (limited to 'js/panels')
-rwxr-xr-xjs/panels/properties.reel/properties.js32
-rwxr-xr-xjs/panels/properties.reel/sections/custom.reel/custom.js2
2 files changed, 22 insertions, 12 deletions
diff --git a/js/panels/properties.reel/properties.js b/js/panels/properties.reel/properties.js
index eb362796..b292a66a 100755
--- a/js/panels/properties.reel/properties.js
+++ b/js/panels/properties.reel/properties.js
@@ -48,6 +48,7 @@ exports.Properties = Montage.create(Component, {
48 value : function() { 48 value : function() {
49 this.eventManager.addEventListener("openDocument", this, false); 49 this.eventManager.addEventListener("openDocument", this, false);
50 this.eventManager.addEventListener("selectionChange", this, false); 50 this.eventManager.addEventListener("selectionChange", this, false);
51 this.eventManager.addEventListener("closeDocument", this, false);
51 52
52 // This will be a toggle option 53 // This will be a toggle option
53 if(this.application.ninja.appData.PILiveUpdate) { 54 if(this.application.ninja.appData.PILiveUpdate) {
@@ -76,6 +77,12 @@ exports.Properties = Montage.create(Component, {
76 } 77 }
77 }, 78 },
78 79
80 handleCloseDocument: {
81 value: function(){
82 this.clear();
83 }
84 },
85
79 /** 86 /**
80 * Blur and Key up to handle change in the Element ID field. 87 * Blur and Key up to handle change in the Element ID field.
81 */ 88 */
@@ -172,6 +179,7 @@ exports.Properties = Montage.create(Component, {
172 this.elementId.value = ""; 179 this.elementId.value = "";
173 this.elementClass.value = ""; 180 this.elementClass.value = "";
174 this.customPi = null; 181 this.customPi = null;
182 this.customSections = [];
175 } 183 }
176 }, 184 },
177 185
@@ -211,27 +219,29 @@ exports.Properties = Montage.create(Component, {
211 controls = this.customSections[n].content.controls; 219 controls = this.customSections[n].content.controls;
212 if(controls["colorSelect"]) { 220 if(controls["colorSelect"]) {
213 controls["colorSelect"].destroy(); 221 controls["colorSelect"].destroy();
214 } else if(controls["stageBackground"]) { 222 } else if(controls["background"]) {
215 controls["stageBackground"].destroy(); 223 controls["background"].destroy();
216 } 224 }
217 } 225 }
218 226
219 this.customPi = el.elementModel.pi; 227 this.customPi = el.elementModel.pi;
220 this.displayCustomProperties(el, el.elementModel.pi); 228 this.displayCustomProperties(el, el.elementModel.pi);
221 }
222 229
223 // Root element color chip 230 // Root element color chip
224 if(isRoot) { 231 if(isRoot) {
225 var backgroundChip = this.customSections[0].content.controls["background"]; 232 var backgroundChip = this.customSections[0].content.controls["background"];
226 var rootBackgroundColor = ElementsMediator.getProperty(el, "background"); 233 var rootBackgroundColor = ElementsMediator.getProperty(el, "background");
227 234
228 if(rootBackgroundColor) { 235 if(rootBackgroundColor) {
229 backgroundChip.color = rootBackgroundColor; 236 backgroundChip.color = rootBackgroundColor;
230 } else { 237 } else {
231 backgroundChip.color = null; 238 backgroundChip.color = null;
239 }
232 } 240 }
233 } 241 }
234 242
243
244
235 var previousInput = this.application.ninja.colorController.colorModel.input; 245 var previousInput = this.application.ninja.colorController.colorModel.input;
236 customPI = PiData[this.customPi]; 246 customPI = PiData[this.customPi];
237 // Get all the custom section for the custom PI 247 // Get all the custom section for the custom PI
diff --git a/js/panels/properties.reel/sections/custom.reel/custom.js b/js/panels/properties.reel/sections/custom.reel/custom.js
index 49b4414e..b1fd910d 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["stageBackground"] = obj; 403 this.controls["background"] = obj;
404 404
405 return obj; 405 return obj;
406 } 406 }