From 8f8f7f9a36fb9abadea2a9f25aef0084946bebc9 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Fri, 4 May 2012 14:42:00 -0700 Subject: Removed special-casing for new template workflow. Instead, we will enforce a width and height on the body in order to do 3d. Signed-off-by: Nivesh Rajbhandari --- js/controllers/elements/body-controller.js | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'js/controllers/elements') diff --git a/js/controllers/elements/body-controller.js b/js/controllers/elements/body-controller.js index 14aeae24..943594f2 100755 --- a/js/controllers/elements/body-controller.js +++ b/js/controllers/elements/body-controller.js @@ -28,11 +28,39 @@ exports.BodyController = Montage.create(ElementController, { getProperty: { value: function(el, p) { + switch(p) { + case "background" : + return this.application.ninja.colorController.getColorObjFromCss(this.application.ninja.stylesController.getElementStyle(el, "background-color", true, true)); + case "border": + return 0; + case "height": + case "width": + case "-webkit-transform-style": + return this.application.ninja.stylesController.getElementStyle(el, p, true, true); + default: + return ElementController.getProperty(el, p, true, true); + //console.log("Undefined Stage property ", p); + } } }, setProperty: { value: function(el, p, value) { + switch(p) { + case "body-background": + case "background": + this.application.ninja.stylesController.setElementStyle(el, "background-color", value, true); + break; + case "overflow": + case "width": + case "height": + case "-webkit-transform-style": + this.application.ninja.stylesController.setElementStyle(el, p, value, true); + this.application.ninja.stage.updatedStage = true; + break; + default: + console.log("Undefined property ", p, "for the Body Controller"); + } } }, -- cgit v1.2.3 From 2088ff54c96af4bd5c96075b74939b50c56f5f24 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Thu, 10 May 2012 12:01:16 -0700 Subject: New stage template should not distinguish between user and template body styles. Signed-off-by: Nivesh Rajbhandari --- js/controllers/elements/body-controller.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'js/controllers/elements') diff --git a/js/controllers/elements/body-controller.js b/js/controllers/elements/body-controller.js index 943594f2..5c23dcf7 100755 --- a/js/controllers/elements/body-controller.js +++ b/js/controllers/elements/body-controller.js @@ -13,7 +13,7 @@ exports.BodyController = Montage.create(ElementController, { set3DProperties: { value: function(el, props, update3DModel) { var dist = props["dist"], mat = props["mat"]; - this.application.ninja.stylesController.setElementStyle(el, "-webkit-transform", "perspective(" + dist + ") " + "matrix3d(" + MathUtils.scientificToDecimal(mat, 5) + ")", true); + this.application.ninja.stylesController.setElementStyle(el, "-webkit-transform", "perspective(" + dist + ") " + "matrix3d(" + MathUtils.scientificToDecimal(mat, 5) + ")"); el.elementModel.props3D.matrix3d = mat; el.elementModel.props3D.perspectiveDist = dist; @@ -49,13 +49,13 @@ exports.BodyController = Montage.create(ElementController, { switch(p) { case "body-background": case "background": - this.application.ninja.stylesController.setElementStyle(el, "background-color", value, true); + this.application.ninja.stylesController.setElementStyle(el, "background-color", value); break; case "overflow": case "width": case "height": case "-webkit-transform-style": - this.application.ninja.stylesController.setElementStyle(el, p, value, true); + this.application.ninja.stylesController.setElementStyle(el, p, value); this.application.ninja.stage.updatedStage = true; break; default: -- cgit v1.2.3 From d6cec6193a16563e9d35d75f0caee49bab927cda Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Thu, 10 May 2012 15:54:29 -0700 Subject: Fixing the google components. Signed-off-by: Valerio Virgillito --- js/controllers/elements/component-controller.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'js/controllers/elements') diff --git a/js/controllers/elements/component-controller.js b/js/controllers/elements/component-controller.js index d902e4a1..41f0f943 100755 --- a/js/controllers/elements/component-controller.js +++ b/js/controllers/elements/component-controller.js @@ -11,7 +11,8 @@ exports.ComponentController = Montage.create(ElementController, { getProperty: { value: function(el, prop) { - var component = el.controller || this.application.ninja.currentDocument.getComponentFromElement(el); + console.log("safdasdasdasd"); + var component = el.controller || this.application.ninja.currentDocument.model.getComponentFromElement(el); switch(prop) { case "id": @@ -34,7 +35,7 @@ exports.ComponentController = Montage.create(ElementController, { setProperty: { value: function(el, p, value) { - var component = el.controller || this.application.ninja.currentDocument.getComponentFromElement(el); + var component = el.controller || this.application.ninja.currentDocument.model.getComponentFromElement(el); switch(p) { case "id": -- cgit v1.2.3 From 8f9be38f9a9ef9c5ee78ae59912ad9254b78a16e Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Thu, 10 May 2012 16:46:10 -0700 Subject: remove console logs Signed-off-by: Valerio Virgillito --- js/controllers/elements/component-controller.js | 1 - 1 file changed, 1 deletion(-) (limited to 'js/controllers/elements') diff --git a/js/controllers/elements/component-controller.js b/js/controllers/elements/component-controller.js index 41f0f943..5b0aaeac 100755 --- a/js/controllers/elements/component-controller.js +++ b/js/controllers/elements/component-controller.js @@ -11,7 +11,6 @@ exports.ComponentController = Montage.create(ElementController, { getProperty: { value: function(el, prop) { - console.log("safdasdasdasd"); var component = el.controller || this.application.ninja.currentDocument.model.getComponentFromElement(el); switch(prop) { -- cgit v1.2.3 From f6f722feecf88c8afe59327eaf8557ce4012abc7 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Thu, 10 May 2012 22:40:02 -0700 Subject: Fixing the dirty document flag. Disabling the stylesheets dirty flag because === true on document open. Signed-off-by: Valerio Virgillito --- js/controllers/elements/shapes-controller.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'js/controllers/elements') diff --git a/js/controllers/elements/shapes-controller.js b/js/controllers/elements/shapes-controller.js index e9a5f865..38f133b5 100755 --- a/js/controllers/elements/shapes-controller.js +++ b/js/controllers/elements/shapes-controller.js @@ -213,7 +213,7 @@ exports.ShapesController = Montage.create(CanvasController, { default: CanvasController.setProperty(el, p, value); } - this.application.ninja.documentController.activeDocument.needsSave = true; + this.application.ninja.documentController.activeDocument.model.needsSave = true; } }, @@ -559,7 +559,7 @@ exports.ShapesController = Montage.create(CanvasController, { } } el.elementModel.shapeModel.GLWorld.render(); - this.application.ninja.documentController.activeDocument.needsSave = true; + this.application.ninja.documentController.activeDocument.model.needsSave = true; } }, -- cgit v1.2.3 From fdfba499f0b84360b96096fa866a981e96e8756c Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Fri, 18 May 2012 16:35:56 -0700 Subject: fixing the color chip for the document root Signed-off-by: Valerio Virgillito --- js/controllers/elements/body-controller.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/controllers/elements') diff --git a/js/controllers/elements/body-controller.js b/js/controllers/elements/body-controller.js index 5c23dcf7..7a3a66f5 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", true, true)); + return this.application.ninja.colorController.getColorObjFromCss(this.application.ninja.stylesController.getElementStyle(el, "background-color", false, true)); case "border": return 0; case "height": -- cgit v1.2.3