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 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'js/controllers') 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) { -- cgit v1.2.3 From 21098080e7716379ceefefca5f3cc1850ac78fa7 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Thu, 7 Jun 2012 15:17:19 -0700 Subject: Body PI fixes. Signed-off-by: Nivesh Rajbhandari --- js/controllers/elements/body-controller.js | 2 +- js/controllers/styles-controller.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'js/controllers') diff --git a/js/controllers/elements/body-controller.js b/js/controllers/elements/body-controller.js index 9c427c62..106fdcd0 100755 --- a/js/controllers/elements/body-controller.js +++ b/js/controllers/elements/body-controller.js @@ -30,7 +30,7 @@ exports.BodyController = Montage.create(ElementController, { value: function(el, p) { switch(p) { case "background" : - return this.application.ninja.colorController.getColorObjFromCss(this.application.ninja.stylesController.getElementStyle(el, "background-color", false, true)); + return this.application.ninja.colorController.getColorObjFromCss(this.application.ninja.stylesController.getElementStyle(el, "background-color")); case "border": return 0; case "height": diff --git a/js/controllers/styles-controller.js b/js/controllers/styles-controller.js index 83722184..a25a05df 100755 --- a/js/controllers/styles-controller.js +++ b/js/controllers/styles-controller.js @@ -154,6 +154,10 @@ var stylesController = exports.StylesController = Montage.create(Component, { styles['-webkit-transform-style'] = 'preserve-3d'; needsRule = true; } + if(this.getElementStyle(this.currentDocument.model.documentRoot, "background-color", false, false) == null) { + styles['background-color'] = "transparent"; + needsRule = true; + } if(needsRule) { rule = this.addRule('.ninja-body{}'); -- cgit v1.2.3