aboutsummaryrefslogtreecommitdiff
path: root/js/panels
diff options
context:
space:
mode:
Diffstat (limited to 'js/panels')
-rw-r--r--js/panels/Timeline/Layer.reel/Layer.js4
-rw-r--r--js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js2
-rw-r--r--js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js4
-rwxr-xr-xjs/panels/components-panel.reel/components-panel.js12
-rwxr-xr-xjs/panels/properties.reel/properties.html10
-rwxr-xr-xjs/panels/properties.reel/properties.js157
-rwxr-xr-xjs/panels/properties.reel/sections/position-size.reel/position-size.css (renamed from js/panels/properties.reel/sections/position-and-size.reel/position-and-size.css)0
-rwxr-xr-xjs/panels/properties.reel/sections/position-size.reel/position-size.html (renamed from js/panels/properties.reel/sections/position-and-size.reel/position-and-size.html)36
-rwxr-xr-xjs/panels/properties.reel/sections/position-size.reel/position-size.js (renamed from js/panels/properties.reel/sections/position-and-size.reel/position-and-size.js)14
9 files changed, 75 insertions, 164 deletions
diff --git a/js/panels/Timeline/Layer.reel/Layer.js b/js/panels/Timeline/Layer.reel/Layer.js
index b23da749..6358a0e0 100644
--- a/js/panels/Timeline/Layer.reel/Layer.js
+++ b/js/panels/Timeline/Layer.reel/Layer.js
@@ -721,7 +721,7 @@ var Layer = exports.Layer = Montage.create(Component, {
721 this.dynamicLayerName.value = this._layerEditable.value; 721 this.dynamicLayerName.value = this._layerEditable.value;
722 this.application.ninja.timeline.currentLayerSelected.layerData.elementsList[0].dataset.storedLayerName = this.dynamicLayerName.value; 722 this.application.ninja.timeline.currentLayerSelected.layerData.elementsList[0].dataset.storedLayerName = this.dynamicLayerName.value;
723 this.needsDraw = true; 723 this.needsDraw = true;
724 this.application.ninja.documentController.activeDocument.needsSave = true; 724 this.application.ninja.documentController.activeDocument.model.needsSave = true;
725 } 725 }
726 }, 726 },
727 handleAddStyleClick: { 727 handleAddStyleClick: {
@@ -749,7 +749,7 @@ var Layer = exports.Layer = Montage.create(Component, {
749 this.dynamicLayerName.value = newVal; 749 this.dynamicLayerName.value = newVal;
750 this.layerName = newVal; 750 this.layerName = newVal;
751 this.application.ninja.timeline.currentLayerSelected.layerData.elementsList[0].dataset.storedLayerName = newVal; 751 this.application.ninja.timeline.currentLayerSelected.layerData.elementsList[0].dataset.storedLayerName = newVal;
752 this.application.ninja.documentController.activeDocument.needsSave = true; 752 this.application.ninja.documentController.activeDocument.model.needsSave = true;
753 this.needsDraw = true; 753 this.needsDraw = true;
754 } 754 }
755 }, 755 },
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
index d1cab096..94ca9b57 100644
--- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
+++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
@@ -994,7 +994,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
994 this.arrLayers.splice(myIndex, 0, thingToPush); 994 this.arrLayers.splice(myIndex, 0, thingToPush);
995 995
996 } 996 }
997 this.selectLayer(myIndex); 997 this.selectLayer(myIndex, false);
998 } 998 }
999 }, 999 },
1000 1000
diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
index efeeba00..2c15a99c 100644
--- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
+++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
@@ -568,7 +568,7 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
568 this.nextKeyframe += 1; 568 this.nextKeyframe += 1;
569 } 569 }
570 570
571 this.application.ninja.documentController.activeDocument.needsSave = true; 571 this.application.ninja.documentController.activeDocument.model.needsSave = true;
572 } 572 }
573 }, 573 },
574 574
@@ -687,7 +687,7 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
687 keyframeString += " }"; 687 keyframeString += " }";
688 // set the keyframe string as the new rule 688 // set the keyframe string as the new rule
689 this.currentKeyframeRule = this.ninjaStylesContoller.addRule(keyframeString); 689 this.currentKeyframeRule = this.ninjaStylesContoller.addRule(keyframeString);
690 this.application.ninja.documentController.activeDocument.needsSave = true; 690 this.application.ninja.documentController.activeDocument.model.needsSave = true;
691 } 691 }
692 }, 692 },
693 693
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 //}
diff --git a/js/panels/properties.reel/properties.html b/js/panels/properties.reel/properties.html
index 3a1ae880..ac0dab5a 100755
--- a/js/panels/properties.reel/properties.html
+++ b/js/panels/properties.reel/properties.html
@@ -38,13 +38,15 @@
38 "prototype": "js/panels/properties.reel/section.reel", 38 "prototype": "js/panels/properties.reel/section.reel",
39 "properties": { 39 "properties": {
40 "element": {"#": "PosSize"}, 40 "element": {"#": "PosSize"},
41 "content" : {"@": "PosSize"}, 41 "content" : {"@": "positionSize"},
42 "name" : "Position And Size" 42 "name" : "Position And Size"
43 } 43 }
44 }, 44 },
45 "PosSize": { 45
46 "prototype": "js/panels/properties.reel/sections/position-and-size.reel[PosSize]" 46 "positionSize": {
47 "prototype": "js/panels/properties.reel/sections/position-size.reel"
47 }, 48 },
49
48 "threeDSection": { 50 "threeDSection": {
49 "prototype": "js/panels/properties.reel/section.reel", 51 "prototype": "js/panels/properties.reel/section.reel",
50 "properties": { 52 "properties": {
@@ -97,7 +99,7 @@
97 "elementName": {"@": "elementName"}, 99 "elementName": {"@": "elementName"},
98 "elementClass": {"@": "elementClass"}, 100 "elementClass": {"@": "elementClass"},
99 "elementId": {"@": "elementId"}, 101 "elementId": {"@": "elementId"},
100 "positionSize": {"@": "PosSize"}, 102 "positionSize": {"@": "positionSize"},
101 "threeD": {"@": "threeDProperties"} 103 "threeD": {"@": "threeDProperties"}
102 } 104 }
103 } 105 }
diff --git a/js/panels/properties.reel/properties.js b/js/panels/properties.reel/properties.js
index 8c2daa14..3ec48687 100755
--- a/js/panels/properties.reel/properties.js
+++ b/js/panels/properties.reel/properties.js
@@ -67,17 +67,12 @@ exports.Properties = Montage.create(Component, {
67 } 67 }
68 }, 68 },
69 69
70 // Document is opened - Display the current selection
71 handleOpenDocument: { 70 handleOpenDocument: {
72 value: function() { 71 value: function() {
73
74 this.eventManager.addEventListener( "elementChange", this, false); 72 this.eventManager.addEventListener( "elementChange", this, false);
75 73
76 // For now always assume that the stage is selected by default when opening the old template 74 // Display the default document root PI
77 // TODO: Remove marker for old template: NINJA-STAGE-REWORK 75 this.displayElementProperties(this.application.ninja.currentDocument.documentRoot);
78 if(this.application.ninja.selectedElements.length === 0 && this.application.ninja.currentDocument.documentRoot.nodeName.toLowerCase() !== "body") {
79 this.displayStageProperties();
80 }
81 } 76 }
82 }, 77 },
83 78
@@ -174,8 +169,7 @@ exports.Properties = Montage.create(Component, {
174 handleSelectionChange: { 169 handleSelectionChange: {
175 value: function(event) { 170 value: function(event) {
176 if(event.detail.isDocument) { 171 if(event.detail.isDocument) {
177 if(this.application.ninja.currentDocument.documentRoot.nodeName.toLowerCase() === "body") return; 172 this.displayElementProperties(this.application.ninja.currentDocument.documentRoot);
178 this.displaySt