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 ++++ js/models/element-model.js | 6 ++++++ 3 files changed, 11 insertions(+), 1 deletion(-) (limited to 'js') 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{}'); diff --git a/js/models/element-model.js b/js/models/element-model.js index c9fb58d8..76f15b21 100755 --- a/js/models/element-model.js +++ b/js/models/element-model.js @@ -49,6 +49,12 @@ var getInfoForElement = function(el) { isShape = true; } + if(el.nodeName.toLowerCase() === "ninja-content") { + elementName = "body"; + controller = elementNameToController(elementName); + pi = elementNameToPi(elementName); + } + // TODO: Add this in case there is no controller for the component /* if(el.getAttribute("data-montage-id")) { -- cgit v1.2.3