aboutsummaryrefslogtreecommitdiff
path: root/js/panels/components-panel.reel
diff options
context:
space:
mode:
authorArmen Kesablyan2012-05-15 16:34:46 -0700
committerArmen Kesablyan2012-05-15 16:34:46 -0700
commitc8d61c8e72e0eba266575f9df54325fa77fde73d (patch)
tree556cafd76ab9b2cf4cc2b4cc3ea17b12ce690b69 /js/panels/components-panel.reel
parent15a3aaebb56cb2c9409bfe55c862868726c7fd44 (diff)
parent46bd3712329cd3c9311e50ed9ee4c2245bd1be5a (diff)
downloadninja-c8d61c8e72e0eba266575f9df54325fa77fde73d.tar.gz
Merge branch 'dom-architecture' of github.com:Motorola-Mobility/ninja-internal into binding
Diffstat (limited to 'js/panels/components-panel.reel')
-rwxr-xr-xjs/panels/components-panel.reel/components-panel.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/js/panels/components-panel.reel/components-panel.js b/js/panels/components-panel.reel/components-panel.js
index 4169423b..87d5082d 100755
--- a/js/panels/components-panel.reel/components-panel.js
+++ b/js/panels/components-panel.reel/components-panel.js
@@ -278,7 +278,7 @@ exports.ComponentsPanel = Montage.create(Component, {
278 that = this; 278 that = this;
279 element = this.makeComponent(component.component); 279 element = this.makeComponent(component.component);
280 280
281 this.application.ninja.currentDocument._window.addComponent(element, {name: component.name, path: component.module}, function(instance, element) { 281 this.application.ninja.currentDocument.model.views.design.iframe.contentWindow.addComponent(element, {name: component.name, path: component.module}, function(instance, element) {
282 282
283 //var pos = that.getStageCenter(); 283 //var pos = that.getStageCenter();
284 284
@@ -297,7 +297,7 @@ exports.ComponentsPanel = Montage.create(Component, {
297 297
298 instance.addEventListener('firstDraw', that, false); 298 instance.addEventListener('firstDraw', that, false);
299 299
300 that.application.ninja.currentDocument.setComponentInstance(instance, element); 300 that.application.ninja.currentDocument.model.setComponentInstance(instance, element);
301 301
302 that.application.ninja.elementMediator.addElements(element, styles); 302 that.application.ninja.elementMediator.addElements(element, styles);
303 }); 303 });
@@ -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 //}