From 25d639e6c7dd737f4671011faf07091c86c0e324 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Thu, 7 Jun 2012 13:13:01 -0700 Subject: fixing the body color chip for non banners templates Signed-off-by: Valerio Virgillito --- js/controllers/elements/body-controller.js | 3 ++- js/controllers/elements/controller-factory.js | 4 ++-- js/panels/properties.reel/properties.js | 4 ++-- js/panels/properties.reel/sections/custom.reel/custom.js | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/js/controllers/elements/body-controller.js b/js/controllers/elements/body-controller.js index 9c427c62..a2aa041f 100755 --- a/js/controllers/elements/body-controller.js +++ b/js/controllers/elements/body-controller.js @@ -30,6 +30,7 @@ exports.BodyController = Montage.create(ElementController, { value: function(el, p) { switch(p) { case "background" : + case "background-color": return this.application.ninja.colorController.getColorObjFromCss(this.application.ninja.stylesController.getElementStyle(el, "background-color", false, true)); case "border": return 0; @@ -47,8 +48,8 @@ exports.BodyController = Montage.create(ElementController, { setProperty: { value: function(el, p, value) { switch(p) { - case "body-background": case "background": + case "background-color": this.application.ninja.stylesController.setElementStyle(el, "background-color", value); break; case "overflow": diff --git a/js/controllers/elements/controller-factory.js b/js/controllers/elements/controller-factory.js index 3ac3fe14..2d2a5cd1 100755 --- a/js/controllers/elements/controller-factory.js +++ b/js/controllers/elements/controller-factory.js @@ -8,7 +8,6 @@ var Montage = require("montage/core/core").Montage; var BodyController = require("js/controllers/elements/body-controller").BodyController, BlockController = require("js/controllers/elements/block-controller").BlockController, - StageController = require("js/controllers/elements/stage-controller").StageController, ShapesController = require("js/controllers/elements/shapes-controller").ShapesController, ImageController = require("js/controllers/elements/image-controller").ImageController, VideoController = require("js/controllers/elements/video-controller").VideoController, @@ -27,7 +26,8 @@ exports.ControllerFactory = Montage.create(Montage, { if(value.indexOf("block") !== -1) { return BlockController; } else if(value.indexOf("stage") !== -1) { - return StageController; +// return StageController; + alert("Calling the stage controller. Should not be calling this object"); } else if(value.indexOf("body") !== -1) { return BodyController; } else if(value.indexOf("shape") !== -1) { diff --git a/js/panels/properties.reel/properties.js b/js/panels/properties.reel/properties.js index 934a3851..cc99ca6c 100755 --- a/js/panels/properties.reel/properties.js +++ b/js/panels/properties.reel/properties.js @@ -243,8 +243,8 @@ exports.Properties = Montage.create(Component, { controls = this.customSections[n].content.controls; if(controls["colorSelect"]) { controls["colorSelect"].destroy(); - } else if(controls["background"]) { - controls["background"].destroy(); + } else if(controls["background-color"]) { + controls["background-color"].destroy(); } } 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, { this.controls[aField.id] = obj; // TODO - Hack for now to reference the color select object to unregister color chips - this.controls["background"] = obj; + this.controls["background-color"] = obj; return obj; } -- cgit v1.2.3