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(-) 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 ec37028c6fe7a6799f9a3b3ee5eb36754c1dc924 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Thu, 10 May 2012 16:12:56 -0700 Subject: Fixing the select and text area PI Signed-off-by: Valerio Virgillito --- js/panels/components-panel.reel/components-panel.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/panels/components-panel.reel/components-panel.js b/js/panels/components-panel.reel/components-panel.js index 9b237229..171bef57 100755 --- a/js/panels/components-panel.reel/components-panel.js +++ b/js/panels/components-panel.reel/components-panel.js @@ -346,7 +346,7 @@ exports.ComponentsPanel = Montage.create(Component, { break; case "select": el = document.application.njUtils.make("select", null, this.application.ninja.currentDocument); - document.application.njUtils.createModelForComponent(el, "Select"); + document.application.njUtils.createModelForComponent(el, "SelectInput"); break; case "radioButton": el = document.application.njUtils.make("input", null, this.application.ninja.currentDocument); @@ -366,7 +366,7 @@ exports.ComponentsPanel = Montage.create(Component, { break; case "textarea": el = document.application.njUtils.make("textarea", null, this.application.ninja.currentDocument); - document.application.njUtils.createModelForComponent(el, "TextArea"); + document.application.njUtils.createModelForComponent(el, "Textarea"); break; case "toggleButton": el = document.application.njUtils.make("button", null, this.application.ninja.currentDocument); -- 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(-) 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 90d158a3372b6c8ac2deb8b82070d76135e72397 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Thu, 10 May 2012 16:49:18 -0700 Subject: Fixing the components double click center stage position. Signed-off-by: Valerio Virgillito --- js/panels/components-panel.reel/components-panel.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/panels/components-panel.reel/components-panel.js b/js/panels/components-panel.reel/components-panel.js index 171bef57..87d5082d 100755 --- a/js/panels/components-panel.reel/components-panel.js +++ b/js/panels/components-panel.reel/components-panel.js @@ -404,8 +404,8 @@ exports.ComponentsPanel = Montage.create(Component, { //if(!this.centerStage) { var top, left; - top = ~~((parseFloat(this.application.ninja.elementMediator.getProperty(this.application.ninja.currentDocument.documentRoot, "height"))) / 2); - left = ~~((parseFloat(this.application.ninja.elementMediator.getProperty(this.application.ninja.currentDocument.documentRoot, "width"))) / 2); + top = (this.application.ninja.stage.canvas.height / 2); // ~~((parseFloat(this.application.ninja.elementMediator.getProperty(this.application.ninja.currentDocument.documentRoot, "height"))) / 2); + left = (this.application.ninja.stage.canvas.width / 2); //~~((parseFloat(this.application.ninja.elementMediator.getProperty(this.application.ninja.currentDocument.documentRoot, "width"))) / 2); //this.centerStage = [top, left]; return [left, top]; //} -- cgit v1.2.3