aboutsummaryrefslogtreecommitdiff
path: root/js/panels/properties.reel
diff options
context:
space:
mode:
Diffstat (limited to 'js/panels/properties.reel')
-rwxr-xr-xjs/panels/properties.reel/properties.js33
1 files changed, 31 insertions, 2 deletions
diff --git a/js/panels/properties.reel/properties.js b/js/panels/properties.reel/properties.js
index eb9faa8b..580d945d 100755
--- a/js/panels/properties.reel/properties.js
+++ b/js/panels/properties.reel/properties.js
@@ -283,7 +283,7 @@ exports.Properties = Montage.create(Component, {
283 this.customPi = el.elementModel.pi; 283 this.customPi = el.elementModel.pi;
284 this.displayCustomProperties(el, el.elementModel.pi); 284 this.displayCustomProperties(el, el.elementModel.pi);
285 } 285 }
286 286 var previousInput = this.application.ninja.colorController.colorModel.input;
287 customPI = PiData[this.customPi]; 287 customPI = PiData[this.customPi];
288 // Get all the custom section for the custom PI 288 // Get all the custom section for the custom PI
289 for(var i = 0, customSec; customSec = customPI[i]; i++) { 289 for(var i = 0, customSec; customSec = customPI[i]; i++) {
@@ -302,13 +302,15 @@ exports.Properties = Montage.create(Component, {
302 } 302 }
303 else 303 else
304 { 304 {
305 currentValue = ElementsMediator.getColor2(el, control.prop, control.valueMutator);
306 if(control.prop === "border") 305 if(control.prop === "border")
307 { 306 {
307 // TODO - For now, always return the top border if multiple border sides
308 currentValue = ElementsMediator.getColor(el, false, "top");
308 this.application.ninja.colorController.colorModel.input = "stroke"; 309 this.application.ninja.colorController.colorModel.input = "stroke";
309 } 310 }
310 else if(control.prop === "background") 311 else if(control.prop === "background")
311 { 312 {
313 currentValue = ElementsMediator.getColor(el, true);
312 this.application.ninja.colorController.colorModel.input = "fill"; 314 this.application.ninja.colorController.colorModel.input = "fill";
313 } 315 }
314 316
@@ -350,6 +352,33 @@ exports.Properties = Montage.create(Component, {
350 } 352 }
351 } 353 }
352 } 354 }
355 this.application.ninja.colorController.colorModel.input = previousInput;
356 var color = this.application.ninja.colorController.colorModel.colorHistory[previousInput][this.application.ninja.colorController.colorModel.colorHistory[previousInput].length-1];
357 color.c.wasSetByCode = true;
358 color.c.type = 'change';
359 switch (color.m) {
360 case 'rgb':
361 this.application.ninja.colorController.colorModel.alpha = {value: color.a, wasSetByCode: true, type: 'change'};
362 this.application.ninja.colorController.colorModel.rgb = color.c;
363 break;
364 case 'hsl':
365 this.application.ninja.colorController.colorModel.alpha = {value: color.a, wasSetByCode: true, type: 'change'};
366 this.application.ninja.colorController.colorModel.hsl = color.c;
367 break;
368 case 'hex':
369 //TODO: Check if anything needed here
370 break;
371 case 'gradient':
372 this.application.ninja.colorController.colorModel.gradient = color.c;
373 break;
374 case 'hsv':
375 this.application.ninja.colorController.colorModel.alpha = {value: color.a, wasSetByCode: true, type: 'change'};
376 this.application.ninja.colorController.colorModel.hsv = color.c;
377 break;
378 default:
379 this.application.ninja.colorController.colorModel.applyNoColor();
380 break;
381 }
353 } 382 }
354 } 383 }
355 }, 384 },