aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorJon Reid2012-05-15 16:09:19 -0700
committerJon Reid2012-05-15 16:09:19 -0700
commit9142fe70f485f5af9725a73f94480237423b02dc (patch)
tree87e164e479119dc9cde899adfd60d98c835bc7c3 /js
parent26f1524c049791cb9cd81695c57b84d952a2e7e6 (diff)
parente9995c973acadc507b802fdefdb22b4c4bf82325 (diff)
downloadninja-9142fe70f485f5af9725a73f94480237423b02dc.tar.gz
Merge remote-tracking branch 'ninja-jduran/TimelineUber' into timeline-multiselect
Diffstat (limited to 'js')
-rw-r--r--js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js26
-rw-r--r--js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js5
-rw-r--r--js/panels/Timeline/Tween.reel/Tween.js11
3 files changed, 35 insertions, 7 deletions
diff --git a/js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js b/js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js
index 31e0b3b6..f2004b94 100644
--- a/js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js
+++ b/js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js
@@ -28,6 +28,21 @@ var PropertyTrack = exports.PropertyTrack = Montage.create(Component, {
28 } 28 }
29 }, 29 },
30 30
31 didDraw:{
32 value:function () {
33 if ((!this.application.ninja.documentController.creatingNewFile) || (!this.application.ninja.currentDocument.setLevel)) {
34 if (this.application.ninja.currentDocument.documentRoot.children[0]) {
35 var selectedIndex = this.application.ninja.timeline.getLayerIndexByID(this.trackID);
36 if (selectedIndex !== false) {
37 if (!this.application.ninja.timeline.arrLayers[selectedIndex].layerData.created) {
38 //this.retrieveStoredStyleTweens();
39 }
40 }
41 }
42 }
43 }
44 },
45
31 trackEditorProperty:{ 46 trackEditorProperty:{
32 value:"" 47 value:""
33 }, 48 },
@@ -186,7 +201,7 @@ var PropertyTrack = exports.PropertyTrack = Montage.create(Component, {
186 //console.log("Property track editorProperty set to: " + this.trackEditorProperty); 201 //console.log("Property track editorProperty set to: " + this.trackEditorProperty);
187 } 202 }
188 } else if (this.trackType === "position") { 203 } else if (this.trackType === "position") {
189 console.log("Property track editorProperty set to: " + this.trackEditorProperty); 204 //console.log("Property track editorProperty set to: " + this.trackEditorProperty);
190 } 205 }
191 206
192 this.insertPropTween(0); 207 this.insertPropTween(0);
@@ -202,7 +217,12 @@ var PropertyTrack = exports.PropertyTrack = Montage.create(Component, {
202 217
203 handleNewPropTween:{ 218 handleNewPropTween:{
204 value:function(ev){ 219 value:function(ev){
205 this.insertPropTween(ev.offsetX); 220 if (ev.offsetX > this.propTweens[this.propTweens.length - 1].tweenData.keyFramePosition) {
221 this.insertPropTween(ev.offsetX);
222 } else {
223 console.log("spitting sub keyframes not yet supported");
224 }
225
206 } 226 }
207 }, 227 },
208 228
@@ -248,7 +268,7 @@ var PropertyTrack = exports.PropertyTrack = Montage.create(Component, {
248 268
249 retrieveStoredStyleTweens:{ 269 retrieveStoredStyleTweens:{
250 value:function(){ 270 value:function(){
251 271 console.log("retrieve style tweens");
252 } 272 }
253 }, 273 },
254 274
diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
index 8693e828..a38ecb30 100644
--- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
+++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
@@ -603,9 +603,13 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
603 this.addAnimationRuleToElement(ev); 603 this.addAnimationRuleToElement(ev);
604 this.updateKeyframeRule(); 604 this.updateKeyframeRule();
605 } else { 605 } else {
606 //console.log(ev);
606 if (ev.target.className === "tracklane") { 607 if (ev.target.className === "tracklane") {
607 this.handleNewTween(ev); 608 this.handleNewTween(ev);
608 this.updateKeyframeRule(); 609 this.updateKeyframeRule();
610 } else if (ev.target.className === "tween_span" && ev.target.parentElement.parentElement.className === "tracklane"){
611 this.handleNewTween(ev);
612 this.updateKeyframeRule();
609 } 613 }
610 } 614 }
611 } else { 615 } else {
@@ -726,6 +730,7 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
726 this.animatedElement = this.application.ninja.timeline.arrLayers[selectedIndex].layerData.elementsList[0]; 730 this.animatedElement = this.application.ninja.timeline.arrLayers[selectedIndex].layerData.elementsList[0];
727 if(this.animatedElement!==undefined){ 731 if(this.animatedElement!==undefined){
728 this.animationName = this.application.ninja.stylesController.getElementStyle(this.animatedElement, "-webkit-animation-name"); 732 this.animationName = this.application.ninja.stylesController.getElementStyle(this.animatedElement, "-webkit-animation-name");
733 this.animationNamesString = this.animationName;
729 if(this.animationName){ 734 if(this.animationName){
730 trackTiming = this.application.ninja.stylesController.getElementStyle(this.animatedElement, "-webkit-animation-duration"); 735 trackTiming = this.application.ninja.stylesController.getElementStyle(this.animatedElement, "-webkit-animation-duration");
731 this.nextKeyframe = 0; 736 this.nextKeyframe = 0;
diff --git a/js/panels/Timeline/Tween.reel/Tween.js b/js/panels/Timeline/Tween.reel/Tween.js
index 3c0223c1..33fed17a 100644
--- a/js/panels/Timeline/Tween.reel/Tween.js
+++ b/js/panels/Timeline/Tween.reel/Tween.js
@@ -234,8 +234,8 @@ var Tween = exports.Tween = Montage.create(Component, {
234 //console.log(eventDetail); 234 //console.log(eventDetail);
235 235
236 if(eventDetail.type == "setProperties"){ 236 if(eventDetail.type == "setProperties"){
237 // ignore top, left, width, and height 237 // need to ignore top, left, width, and height
238 console.log(eventDetail.data.value[0]); 238 //console.log(eventDetail.data.value[0]);
239 this.tweenedProperties[this.parentComponent.parentComponent.trackEditorProperty] = eventDetail.data.value[0]; 239 this.tweenedProperties[this.parentComponent.parentComponent.trackEditorProperty] = eventDetail.data.value[0];
240 this.parentComponent.parentComponent.updatePropKeyframeRule(); 240 this.parentComponent.parentComponent.updatePropKeyframeRule();
241 241
@@ -245,8 +245,8 @@ var Tween = exports.Tween = Montage.create(Component, {
245 this.parentComponent.parentComponent.updatePropKeyframeRule(); 245 this.parentComponent.parentComponent.updatePropKeyframeRule();
246 246
247 } else if(eventDetail.type == "setProperty"){ 247 } else if(eventDetail.type == "setProperty"){
248 // ignore top, left, width, and height 248 // need to ignore top, left, width, and height
249 console.log(eventDetail.data.value[0]); 249 //console.log(eventDetail.data.value[0]);
250 this.tweenedProperties[this.parentComponent.parentComponent.trackEditorProperty] = eventDetail.data.value[0]; 250 this.tweenedProperties[this.parentComponent.parentComponent.trackEditorProperty] = eventDetail.data.value[0];
251 this.parentComponent.parentComponent.updatePropKeyframeRule(); 251 this.parentComponent.parentComponent.updatePropKeyframeRule();
252 252
@@ -278,6 +278,9 @@ var Tween = exports.Tween = Montage.create(Component, {
278 278
279 if(this.parentComponent.parentComponent.isSubproperty){ 279 if(this.parentComponent.parentComponent.isSubproperty){
280 // set property specific style on element 280 // set property specific style on element
281 var currentValue = this.tweenedProperties[this.parentComponent.parentComponent.trackEditorProperty];
282 this.application.ninja.elementMediator.setProperty([this.parentComponent.parentComponent.animatedElement], this.parentComponent.parentComponent.trackEditorProperty, [currentValue], "Change", "tween");
283 //console.log(currentValue);
281 } else { 284 } else {
282 // move animated element to correct position on stage 285 // move animated element to correct position on stage
283 var currentTop = this.tweenedProperties["top"] + "px"; 286 var currentTop = this.tweenedProperties["top"] + "px";