aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
Diffstat (limited to 'js')
-rwxr-xr-xjs/controllers/elements/element-controller.js12
-rwxr-xr-xjs/mediators/element-mediator.js2
-rw-r--r--js/panels/Timeline/Keyframe.reel/Keyframe.js5
-rw-r--r--js/panels/Timeline/Layer.reel/Layer.html4
-rw-r--r--js/panels/Timeline/Layer.reel/Layer.js122
-rw-r--r--js/panels/Timeline/Style.reel/Style.js25
-rw-r--r--js/panels/Timeline/Tween.reel/Tween.js3
7 files changed, 128 insertions, 45 deletions
diff --git a/js/controllers/elements/element-controller.js b/js/controllers/elements/element-controller.js
index f37a9249..da8afbaa 100755
--- a/js/controllers/elements/element-controller.js
+++ b/js/controllers/elements/element-controller.js
@@ -99,9 +99,9 @@ exports.ElementController = Montage.create(Component, {
99 99
100 // Return cached value if one exists 100 // Return cached value if one exists
101 if(isFill) { 101 if(isFill) {
102 if(el.elementModel.fill) { 102// if(el.elementModel.fill) {
103 return el.elementModel.fill; 103// return el.elementModel.fill;
104 } 104// }
105 //TODO: Once logic for color and gradient is established, this needs to be revised 105 //TODO: Once logic for color and gradient is established, this needs to be revised
106 color = this.getProperty(el, "background-color"); 106 color = this.getProperty(el, "background-color");
107 image = this.getProperty(el, "background-image"); 107 image = this.getProperty(el, "background-image");
@@ -114,9 +114,9 @@ exports.ElementController = Montage.create(Component, {
114 114
115 // If no color was found, look up the shared border color 115 // If no color was found, look up the shared border color
116 if(!color && !image) { 116 if(!color && !image) {
117 if(el.elementModel.stroke) { 117// if(el.elementModel.stroke) {
118 return el.elementModel.stroke; 118// return el.elementModel.stroke;
119 } 119// }
120 120
121 color = this.getProperty(el, "border-color"); 121 color = this.getProperty(el, "border-color");
122 image = this.getProperty(el, "border-image"); 122 image = this.getProperty(el, "border-image");
diff --git a/js/mediators/element-mediator.js b/js/mediators/element-mediator.js
index 6449a625..67f2a562 100755
--- a/js/mediators/element-mediator.js
+++ b/js/mediators/element-mediator.js
@@ -369,7 +369,7 @@ exports.ElementMediator = Montage.create(Component, {
369 item.elementModel.controller["setColor"](item, value, isFill,borderSide); 369 item.elementModel.controller["setColor"](item, value, isFill,borderSide);
370 } 370 }
371 371
372 NJevent("element" + eventType, {type : "setColor", source: source, data: {"els": els, "prop": "color", "value": value, "isFill": isFill}, redraw: null}); 372 NJevent("element" + eventType, {type : "setColor", source: source, data: {"els": els, "prop": "color", "value": value, "isFill": isFill, "borderSide":borderSide}, redraw: null});
373 } 373 }
374 }, 374 },
375 375
diff --git a/js/panels/Timeline/Keyframe.reel/Keyframe.js b/js/panels/Timeline/Keyframe.reel/Keyframe.js
index c8255cc0..f450dd8a 100644
--- a/js/panels/Timeline/Keyframe.reel/Keyframe.js
+++ b/js/panels/Timeline/Keyframe.reel/Keyframe.js
@@ -60,6 +60,7 @@ var Keyframe = exports.Keyframe = Montage.create(Component, {
60 if(this.isSelected){ 60 if(this.isSelected){
61 this.element.classList.add("keyframeSelected"); 61 this.element.classList.add("keyframeSelected");
62 this.application.ninja.timeline.selectedStyle = this.parentComponent.parentComponent.parentComponent.trackEditorProperty; 62 this.application.ninja.timeline.selectedStyle = this.parentComponent.parentComponent.parentComponent.trackEditorProperty;
63 console.log(this.application.ninja.timeline.selectedStyle)
63 }else{ 64 }else{
64 this.element.classList.remove("keyframeSelected"); 65 this.element.classList.remove("keyframeSelected");
65 this.application.ninja.timeline.selectedStyle = !(this.parentComponent.parentComponent.parentComponent.trackEditorProperty); 66 this.application.ninja.timeline.selectedStyle = !(this.parentComponent.parentComponent.parentComponent.trackEditorProperty);
@@ -70,17 +71,17 @@ var Keyframe = exports.Keyframe = Montage.create(Component, {
70 71
71 deselectKeyframe:{ 72 deselectKeyframe:{
72 value:function(){ 73 value:function(){
73 debugger;
74 this.isSelected=false; 74 this.isSelected=false;
75 this.element.style.left = (this.position - 5) + "px"; 75 this.element.style.left = (this.position - 5) + "px";
76 this.application.ninja.timeline.selectedStyle = !(this.parentComponent.parentComponent.parentComponent.trackEditorProperty)
76 } 77 }
77 }, 78 },
78 79
79 selectKeyframe:{ 80 selectKeyframe:{
80 value:function(){ 81 value:function(){
81 debugger;
82 this.isSelected=true; 82 this.isSelected=true;
83 this.element.style.left = (this.position - 6) + "px"; 83 this.element.style.left = (this.position - 6) + "px";
84 this.application.ninja.timeline.selectedStyle = this.parentComponent.parentComponent.parentComponent.trackEditorProperty
84 this.parentComponent.selectTween(); 85 this.parentComponent.selectTween();
85 } 86 }
86 }, 87 },
diff --git a/js/panels/Timeline/Layer.reel/Layer.html b/js/panels/Timeline/Layer.reel/Layer.html
index fe3f49d2..3648cbbb 100644
--- a/js/panels/Timeline/Layer.reel/Layer.html
+++ b/js/panels/Timeline/Layer.reel/Layer.html
@@ -111,9 +111,9 @@
111 "boundObjectPropertyPath" : "objectAtCurrentIteration.ruleTweener", 111 "boundObjectPropertyPath" : "objectAtCurrentIteration.ruleTweener",
112 "oneway" : false 112 "oneway" : false
113 }, 113 },
114 "abcelement" : { 114 "colorelement" : {
115 "boundObject" : {"@": "repetition1"}, 115 "boundObject" : {"@": "repetition1"},
116 "boundObjectPropertyPath" : "objectAtCurrentIteration.abcelement", 116 "boundObjectPropertyPath" : "objectAtCurrentIteration.colorelement",
117 "oneway" : false 117 "oneway" : false
118 } 118 }
119 } 119 }
diff --git a/js/panels/Timeline/Layer.reel/Layer.js b/js/panels/Timeline/Layer.reel/Layer.js
index 23ba1ef9..629b118c 100644
--- a/js/panels/Timeline/Layer.reel/Layer.js
+++ b/js/panels/Timeline/Layer.reel/Layer.js
@@ -654,7 +654,7 @@ var Layer = exports.Layer = Montage.create(Component, {
654 newStyle.editorValue = ""; 654 newStyle.editorValue = "";
655 newStyle.ruleTweener = false; 655 newStyle.ruleTweener = false;
656 newStyle.isSelected = false; 656 newStyle.isSelected = false;
657 newStyle.abcelement = ""; 657 newStyle.colorelement = "";
658 this.arrLayerStyles.push(newStyle); 658 this.arrLayerStyles.push(newStyle);
659 659
660 // Set up the event info and dispatch the event 660 // Set up the event info and dispatch the event
@@ -920,7 +920,7 @@ var Layer = exports.Layer = Montage.create(Component, {
920 if(this.application.ninja.timeline.selectedStyle==="left" ||this.application.ninja.timeline.selectedStyle==="master" ){ 920 if(this.application.ninja.timeline.selectedStyle==="left" ||this.application.ninja.timeline.selectedStyle==="master" ){
921 if(!event.wasSetByCode) { 921 if(!event.wasSetByCode) {
922 if(this.savedPosition) prevPosition = [this.savedPosition + "px"]; 922 if(this.savedPosition) prevPosition = [this.savedPosition + "px"];
923 this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "left", [this.leftControl.value + "px"] , "Change", "pi", prevPosition); 923 this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "left", [this.leftControl.value + "px"] , "Change", "timeline", prevPosition);
924 this.savedPosition = null; 924 this.savedPosition = null;
925 } 925 }
926 926
@@ -935,7 +935,7 @@ var Layer = exports.Layer = Montage.create(Component, {
935 if(!event.wasSetByCode) { 935 if(!event.wasSetByCode) {
936 if(this.savedPosition) prevPosition = [this.savedPosition + "px"]; 936 if(this.savedPosition) prevPosition = [this.savedPosition + "px"];
937 937
938 this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "top", [this.topControl.value + "px"] , "Change", "pi", prevPosition); 938 this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "top", [this.topControl.value + "px"] , "Change", "timeline", prevPosition);
939 this.savedPosition = null; 939 this.savedPosition = null;
940 } 940 }
941 } 941 }
@@ -949,7 +949,7 @@ var Layer = exports.Layer = Montage.create(Component, {
949 if(!event.wasSetByCode) { 949 if(!event.wasSetByCode) {
950 if(this.savedPosition) prevPosition = [this.savedPosition + "px"]; 950 if(this.savedPosition) prevPosition = [this.savedPosition + "px"];
951 951
952 this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "width", [this.dtextScaleX + "px"] , "Change", "pi", prevPosition); 952 this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "width", [this.dtextScaleX + "px"] , "Change", "timeline", prevPosition);
953 this.savedPosition = null; 953 this.savedPosition = null;
954 } 954 }
955 } 955 }
@@ -963,7 +963,7 @@ var Layer = exports.Layer = Montage.create(Component, {
963 if(!event.wasSetByCode) { 963 if(!event.wasSetByCode) {
964 if(this.savedPosition) prevPosition = [this.savedPosition + "px"]; 964 if(this.savedPosition) prevPosition = [this.savedPosition + "px"];
965 965
966 this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "height", [this.dtextScaleY + "px"] , "Change", "pi", prevPosition); 966 this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "height", [this.dtextScaleY + "px"] , "Change", "timeline", prevPosition);
967 this.savedPosition = null; 967 this.savedPosition = null;
968 } 968 }
969 } 969 }
@@ -972,10 +972,11 @@ var Layer = exports.Layer = Montage.create(Component, {
972 972
973 handleLeftChanging: { 973 handleLeftChanging: {
974 value: function(event) { 974 value: function(event) {
975
975 if(this.application.ninja.timeline.selectedStyle==="left" ||this.application.ninja.timeline.selectedStyle==="master" ){ 976 if(this.application.ninja.timeline.selectedStyle==="left" ||this.application.ninja.timeline.selectedStyle==="master" ){
976 if(!event.wasSetByCode) { 977 if(!event.wasSetByCode) {
977 if(!this.savedPosition) this.savedPosition = this.leftPosition; 978 if(!this.savedPosition) this.savedPosition = this.leftPosition;
978 this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "left", [this.leftControl.value + "px"] , "Changing", "pi"); 979 this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "left", [this.leftControl.value + "px"] , "Changing", "timeline");
979 } 980 }
980 } 981 }
981 982
@@ -987,7 +988,7 @@ var Layer = exports.Layer = Montage.create(Component, {
987 if(this.application.ninja.timeline.selectedStyle==="top" ||this.application.ninja.timeline.selectedStyle==="master" ){ 988 if(this.application.ninja.timeline.selectedStyle==="top" ||this.application.ninja.timeline.selectedStyle==="master" ){
988 if(!event.wasSetByCode) { 989 if(!event.wasSetByCode) {
989 if(!this.savedPosition) this.savedPosition = this.topPosition; 990 if(!this.savedPosition) this.savedPosition = this.topPosition;
990 this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "top", [this.topControl.value + "px"] , "Changing", "pi"); 991 this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "top", [this.topControl.value + "px"] , "Changing", "timeline");
991 } 992 }
992 } 993 }
993 994
@@ -999,7 +1000,7 @@ var Layer = exports.Layer = Montage.create(Component, {
999 if(this.application.ninja.timeline.selectedStyle==="width" ||this.application.ninja.timeline.selectedStyle==="master" ){ 1000 if(this.application.ninja.timeline.selectedStyle==="width" ||this.application.ninja.timeline.selectedStyle==="master" ){
1000 if(!event.wasSetByCode) { 1001 if(!event.wasSetByCode) {
1001 if(!this.savedPosition) this.savedPosition = this.dtextScaleX; 1002 if(!this.savedPosition) this.savedPosition = this.dtextScaleX;
1002 this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "width", [this.dtextScaleX + "px"] , "Changing", "pi"); 1003 this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "width", [this.dtextScaleX + "px"] , "Changing", "timeline");
1003 } 1004 }
1004 } 1005 }
1005 1006
@@ -1011,7 +1012,7 @@ var Layer = exports.Layer = Montage.create(Component, {