aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorValerio Virgillito2012-05-10 16:51:22 -0700
committerValerio Virgillito2012-05-10 16:51:22 -0700
commitcba4e3615f9d922a4bee9a72b48db06694b9bb81 (patch)
tree7f99f56cc61cb098ca0366a7d7cdea1c9a9040e7 /js
parentc23c4bad96ebc4c2f85070e4cc2511030cac05fc (diff)
parent90d158a3372b6c8ac2deb8b82070d76135e72397 (diff)
downloadninja-cba4e3615f9d922a4bee9a72b48db06694b9bb81.tar.gz
Merge pull request #216 from mencio/dom-architecture
Dom architecture - Fixed components positions and pi
Diffstat (limited to 'js')
-rwxr-xr-xjs/controllers/elements/component-controller.js4
-rwxr-xr-xjs/panels/components-panel.reel/components-panel.js8
2 files changed, 6 insertions, 6 deletions
diff --git a/js/controllers/elements/component-controller.js b/js/controllers/elements/component-controller.js
index d902e4a1..5b0aaeac 100755
--- a/js/controllers/elements/component-controller.js
+++ b/js/controllers/elements/component-controller.js
@@ -11,7 +11,7 @@ exports.ComponentController = Montage.create(ElementController, {
11 11
12 getProperty: { 12 getProperty: {
13 value: function(el, prop) { 13 value: function(el, prop) {
14 var component = el.controller || this.application.ninja.currentDocument.getComponentFromElement(el); 14 var component = el.controller || this.application.ninja.currentDocument.model.getComponentFromElement(el);
15 15
16 switch(prop) { 16 switch(prop) {
17 case "id": 17 case "id":
@@ -34,7 +34,7 @@ exports.ComponentController = Montage.create(ElementController, {
34 34
35 setProperty: { 35 setProperty: {
36 value: function(el, p, value) { 36 value: function(el, p, value) {
37 var component = el.controller || this.application.ninja.currentDocument.getComponentFromElement(el); 37 var component = el.controller || this.application.ninja.currentDocument.model.getComponentFromElement(el);
38 38
39 switch(p) { 39 switch(p) {
40 case "id": 40 case "id":
diff --git a/js/panels/components-panel.reel/components-panel.js b/js/panels/components-panel.reel/components-panel.js
index 9b237229..87d5082d 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, {
346 break; 346 break;
347 case "select": 347 case "select":
348 el = document.application.njUtils.make("select", null, this.application.ninja.currentDocument); 348 el = document.application.njUtils.make("select", null, this.application.ninja.currentDocument);
349 document.application.njUtils.createModelForComponent(el, "Select"); 349 document.application.njUtils.createModelForComponent(el, "SelectInput");
350 break; 350 break;
351 case "radioButton": 351 case "radioButton":
352 el = document.application.njUtils.make("input", null, this.application.ninja.currentDocument); 352 el = document.application.njUtils.make("input", null, this.application.ninja.currentDocument);
@@ -366,7 +366,7 @@ exports.ComponentsPanel = Montage.create(Component, {
366 break; 366 break;
367 case "textarea": 367 case "textarea":
368 el = document.application.njUtils.make("textarea", null, this.application.ninja.currentDocument); 368 el = document.application.njUtils.make("textarea", null, this.application.ninja.currentDocument);
369 document.application.njUtils.createModelForComponent(el, "TextArea"); 369 document.application.njUtils.createModelForComponent(el, "Textarea");
370 break; 370 break;
371 case "toggleButton": 371 case "toggleButton":
372 el = document.application.njUtils.make("button", null, this.application.ninja.currentDocument); 372 el = document.application.njUtils.make("button", null, this.application.ninja.currentDocument);
@@ -404,8 +404,8 @@ exports.ComponentsPanel = Montage.create(Component, {
404 //if(!this.centerStage) { 404 //if(!this.centerStage) {
405 var top, left; 405 var top, left;
406 406
407 top = ~~((parseFloat(this.application.ninja.elementMediator.getProperty(this.application.ninja.currentDocument.documentRoot, "height"))) / 2); 407 top = (this.application.ninja.stage.canvas.height / 2); // ~~((parseFloat(this.application.ninja.elementMediator.getProperty(this.application.ninja.currentDocument.documentRoot, "height"))) / 2);
408 left = ~~((parseFloat(this.application.ninja.elementMediator.getProperty(this.application.ninja.currentDocument.documentRoot, "width"))) / 2); 408 left = (this.application.ninja.stage.canvas.width / 2); //~~((parseFloat(this.application.ninja.elementMediator.getProperty(this.application.ninja.currentDocument.documentRoot, "width"))) / 2);
409 //this.centerStage = [top, left]; 409 //this.centerStage = [top, left];
410 return [left, top]; 410 return [left, top];
411 //} 411 //}