From a30d76ff641ce89686cf5fbd9f04ac9ab4e9c830 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Fri, 10 Feb 2012 17:21:28 -0800 Subject: initial color chip for the stage Signed-off-by: Valerio Virgillito --- js/panels/properties/content.reel/content.js | 37 ++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'js/panels/properties/content.reel') diff --git a/js/panels/properties/content.reel/content.js b/js/panels/properties/content.reel/content.js index 0088447a..b15f2d71 100644 --- a/js/panels/properties/content.reel/content.js +++ b/js/panels/properties/content.reel/content.js @@ -150,6 +150,43 @@ exports.Content = Montage.create(Component, { this.customPi = stage.elementModel.pi; this.displayCustomProperties(stage, stage.elementModel.pi); } + + // For now hardcode the background since it is the only custom property + // No need to loop through all the properties. + var backgroundChip = this.customSections[0].content.controls["background"]; + backgroundChip.initialColor = ElementsMediator.getProperty(stage, "background"); + + // Get stage color + //var backgroundColor = + //console.log(backgroundColor); + + /* + var customPI = PiData[this.customPi]; + // Get all the custom section for the custom PI + for(var i = 0, customSec; customSec = customPI[i]; i++) { + + // Now set the Fields for the custom PI + for(var j = 0, fields; fields = customSec.Section[j]; j++) { + for(var k = 0, control; control = fields[k]; k++) { + + var colorChipEl = this.customSections[i].content.controls[control.id]; + this.foo = colorChipEl; + colorChipEl.addEventListener("firstDraw", this, false); + + } + } + } + */ + } + }, + + foo: { + value: null + }, + + handleFirstDraw: { + value: function() { + this.foo.chipBtn.color('rgb', {wasSetByCode: true, type: 'change', color: {r: 255, g: 0, b: 0}, css: 'rgb(255,0,0)'}); } }, -- cgit v1.2.3 From 0d7d6d4d98437a93f31ededa14ca6eb5382c9e58 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Mon, 13 Feb 2012 14:05:10 -0800 Subject: Cleaning up the stage background color chip. Signed-off-by: Valerio Virgillito --- js/panels/properties/content.reel/content.js | 8 -------- 1 file changed, 8 deletions(-) (limited to 'js/panels/properties/content.reel') diff --git a/js/panels/properties/content.reel/content.js b/js/panels/properties/content.reel/content.js index b15f2d71..1ec6d769 100644 --- a/js/panels/properties/content.reel/content.js +++ b/js/panels/properties/content.reel/content.js @@ -156,10 +156,6 @@ exports.Content = Montage.create(Component, { var backgroundChip = this.customSections[0].content.controls["background"]; backgroundChip.initialColor = ElementsMediator.getProperty(stage, "background"); - // Get stage color - //var backgroundColor = - //console.log(backgroundColor); - /* var customPI = PiData[this.customPi]; // Get all the custom section for the custom PI @@ -180,10 +176,6 @@ exports.Content = Montage.create(Component, { } }, - foo: { - value: null - }, - handleFirstDraw: { value: function() { this.foo.chipBtn.color('rgb', {wasSetByCode: true, type: 'change', color: {r: 255, g: 0, b: 0}, css: 'rgb(255,0,0)'}); -- cgit v1.2.3