aboutsummaryrefslogtreecommitdiff
path: root/js/panels/properties.reel
diff options
context:
space:
mode:
authorValerio Virgillito2012-06-28 14:08:06 -0700
committerValerio Virgillito2012-06-28 14:08:06 -0700
commit3ba9accb8e1887bfd6f1f912b6135073a3d9c70c (patch)
tree82984e11a4103265674bb27161a3f76023f9caae /js/panels/properties.reel
parent56d6311f398e04eee3883a5c848fec3b2b53c981 (diff)
parentc1a3bfcc53e4526d5bb54687ba18ccaaefa96fc2 (diff)
downloadninja-3ba9accb8e1887bfd6f1f912b6135073a3d9c70c.tar.gz
Merge pull request #349 from joseeight/Color
Color
Diffstat (limited to 'js/panels/properties.reel')
-rwxr-xr-xjs/panels/properties.reel/properties.js19
-rwxr-xr-xjs/panels/properties.reel/sections/custom.reel/custom.js16
2 files changed, 30 insertions, 5 deletions
diff --git a/js/panels/properties.reel/properties.js b/js/panels/properties.reel/properties.js
index 5719a63d..b2941fe8 100755
--- a/js/panels/properties.reel/properties.js
+++ b/js/panels/properties.reel/properties.js
@@ -296,9 +296,20 @@ exports.Properties = Montage.create(Component, {
296 296
297 // Root element color chip 297 // Root element color chip
298 if(isRoot) { 298 if(isRoot) {
299 var backgroundChip = this.customSections[0].content.controls["background"]; 299 //
300 var rootBackgroundColor = ElementsMediator.getProperty(el, "background"); 300 var rootBackgroundColor, backgroundChip = this.customSections[0].content.controls["background"];
301 301 //
302 if (ElementsMediator.getProperty(el, "background-image")) {
303 rootBackgroundColor = ElementsMediator.getProperty(el, "background-image");
304 if (!rootBackgroundColor.mode) rootBackgroundColor = null;
305 } else if (ElementsMediator.getProperty(el, "background-color")){
306 rootBackgroundColor = ElementsMediator.getProperty(el, "background-color");
307 if (!rootBackgroundColor.mode) rootBackgroundColor = null;
308 } else if (ElementsMediator.getProperty(el, "background")){
309 rootBackgroundColor = ElementsMediator.getProperty(el, "background");
310 if (!rootBackgroundColor.mode) rootBackgroundColor = null;
311 }
312 //
302 if(rootBackgroundColor) { 313 if(rootBackgroundColor) {
303 backgroundChip.color = rootBackgroundColor; 314 backgroundChip.color = rootBackgroundColor;
304 } else { 315 } else {
@@ -373,7 +384,7 @@ exports.Properties = Montage.create(Component, {
373 } 384 }
374 } 385 }
375 } 386 }
376 387 if (previousInput === 'chip') return;
377 this.application.ninja.colorController.colorModel.input = previousInput; 388 this.application.ninja.colorController.colorModel.input = previousInput;
378 var color = this.application.ninja.colorController.colorModel.colorHistory[previousInput][this.application.ninja.colorController.colorModel.colorHistory[previousInput].length-1]; 389 var color = this.application.ninja.colorController.colorModel.colorHistory[previousInput][this.application.ninja.colorController.colorModel.colorHistory[previousInput].length-1];
379 color.c.wasSetByCode = true; 390 color.c.wasSetByCode = true;
diff --git a/js/panels/properties.reel/sections/custom.reel/custom.js b/js/panels/properties.reel/sections/custom.reel/custom.js
index 9c31cf45..5112fca9 100755
--- a/js/panels/properties.reel/sections/custom.reel/custom.js
+++ b/js/panels/properties.reel/sections/custom.reel/custom.js
@@ -115,11 +115,25 @@ exports.CustomSection = Montage.create(Component, {
115 value: function(event) { 115 value: function(event) {
116 // Change the stage color for now 116 // Change the stage color for now
117 //console.log(this, event); 117 //console.log(this, event);
118 if (event._event.color && event._event.color.css) { 118
119 if (event._event.colorMode !== 'gradient' && event._event.color) {
120 ElementsMediator.setProperty([this.application.ninja.currentDocument.model.documentRoot], 'background-color', [event._event.color.css], "Change", "pi", '');
121 ElementsMediator.setProperty([this.application.ninja.currentDocument.model.documentRoot], 'background-image', ['none'], "Change", "pi", '');
122 } else if (event._event.color) {
123 ElementsMediator.setProperty([this.application.ninja.currentDocument.model.documentRoot], 'background-image', [event._event.color.css], "Change", "pi", '');
124 ElementsMediator.setProperty([this.application.ninja.currentDocument.model.documentRoot], 'background-color', ['none'], "Change", "pi", '');
125 } else {
126 ElementsMediator.setProperty([this.application.ninja.currentDocument.model.documentRoot], 'background-image', ['none'], "Change", "pi", '');
127 ElementsMediator.setProperty([this.application.ninja.currentDocument.model.documentRoot], 'background-color', ['none'], "Change", "pi", '');
128 }
129
130 /*
131if (event._event.color && event._event.color.css) {
119 ElementsMediator.setProperty([this.application.ninja.currentDocument.model.documentRoot], this.id, [event._event.color.css], "Change", "pi", ''); 132 ElementsMediator.setProperty([this.application.ninja.currentDocument.model.documentRoot], this.id, [event._event.color.css], "Change", "pi", '');
120 } else { 133 } else {
121 ElementsMediator.setProperty([this.application.ninja.currentDocument.model.documentRoot], this.id, ['none'], "Change", "pi", ''); 134 ElementsMediator.setProperty([this.application.ninja.currentDocument.model.documentRoot], this.id, ['none'], "Change", "pi", '');
122 } 135 }
136*/
123 /* 137 /*
124 var propEvent = document.createEvent("CustomEvent"); 138 var propEvent = document.createEvent("CustomEvent");
125 propEvent.initEvent("propertyChange", true, true); 139 propEvent.initEvent("propertyChange", true, true);