aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
Diffstat (limited to 'js')
-rw-r--r--js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js12
-rw-r--r--js/panels/Timeline/Tween.reel/Tween.js18
2 files changed, 20 insertions, 10 deletions
diff --git a/js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js b/js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js
index 83d4ce73..60da4e71 100644
--- a/js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js
+++ b/js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js
@@ -35,6 +35,10 @@ var PropertyTrack = exports.PropertyTrack = Montage.create(Component, {
35 value:null 35 value:null
36 }, 36 },
37 37
38 isSubproperty:{
39 value:true
40 },
41
38 propTweenRepetition:{ 42 propTweenRepetition:{
39 serializable:true, 43 serializable:true,
40 get:function () { 44 get:function () {
@@ -111,11 +115,7 @@ var PropertyTrack = exports.PropertyTrack = Montage.create(Component, {
111 115
112 handleClick:{ 116 handleClick:{
113 value:function(ev){ 117 value:function(ev){
114 var parentTrackID = this.parentComponent.parentComponent.parentComponent.trackID;
115 var selectedIndex = this.application.ninja.timeline.getLayerIndexByID(parentTrackID);
116 //console.log(this.application.ninja.timeline.arrLayers[selectedIndex].layerData); 118 //console.log(this.application.ninja.timeline.arrLayers[selectedIndex].layerData);
117 this.application.ninja.timeline.selectLayer(selectedIndex, true);
118
119 if (ev.shiftKey) { 119 if (ev.shiftKey) {
120 if (this.propTweens.length < 1) { 120 if (this.propTweens.length < 1) {
121 this.insertPropTween(0); 121 this.insertPropTween(0);
@@ -137,6 +137,10 @@ var PropertyTrack = exports.PropertyTrack = Montage.create(Component, {
137 137
138 insertPropTween:{ 138 insertPropTween:{
139 value:function(clickPos){ 139 value:function(clickPos){
140 var parentTrackID = this.parentComponent.parentComponent.parentComponent.trackID;
141 var selectedIndex = this.application.ninja.timeline.getLayerIndexByID(parentTrackID);
142 this.application.ninja.timeline.selectLayer(selectedIndex, true);
143
140 var currentMillisecPerPixel = Math.floor(this.application.ninja.timeline.millisecondsOffset / 80); 144 var currentMillisecPerPixel = Math.floor(this.application.ninja.timeline.millisecondsOffset / 80);
141 var currentMillisec = currentMillisecPerPixel * clickPos; 145 var currentMillisec = currentMillisecPerPixel * clickPos;
142 146
diff --git a/js/panels/Timeline/Tween.reel/Tween.js b/js/panels/Timeline/Tween.reel/Tween.js
index 8b6826ed..45714079 100644
--- a/js/panels/Timeline/Tween.reel/Tween.js
+++ b/js/panels/Timeline/Tween.reel/Tween.js
@@ -225,6 +225,8 @@ var Tween = exports.Tween = Montage.create(Component, {
225 225
226 selectTween:{ 226 selectTween:{
227 value: function(){ 227 value: function(){
228 console.log("tween select");
229
228 // turn on event listener for element change 230 // turn on event listener for element change
229 this.eventManager.addEventListener("elementChange", this, false); 231 this.eventManager.addEventListener("elementChange", this, false);
230 232
@@ -243,13 +245,17 @@ var Tween = exports.Tween = Montage.create(Component, {
243 var currentMillisec = currentMillisecPerPixel * this.keyFramePosition; 245 var currentMillisec = currentMillisecPerPixel * this.keyFramePosition;
244 this.application.ninja.timeline.updateTimeText(currentMillisec); 246 this.application.ninja.timeline.updateTimeText(currentMillisec);
245 247
246 // move animated element to correct position on stage 248 if(this.parentComponent.parentComponent.isSubproperty){
247 var currentTop = this.tweenedProperties["top"] + "px"; 249 console.log("sub prop tween selection");
248 var currentLeft = this.tweenedProperties["left"] + "px"; 250 // set property specific style on element
249 251 } else {
250 this.application.ninja.elementMediator.setProperty([this.parentComponent.parentComponent.animatedElement], "top", [currentTop], "Change", "tween"); 252 // move animated element to correct position on stage
251 this.application.ninja.elementMediator.setProperty([this.parentComponent.parentComponent.animatedElement], "left", [currentLeft], "Change", "tween"); 253 var currentTop = this.tweenedProperties["top"] + "px";
254 var currentLeft = this.tweenedProperties["left"] + "px";
252 255
256 this.application.ninja.elementMediator.setProperty([this.parentComponent.parentComponent.animatedElement], "top", [currentTop], "Change", "tween");
257 this.application.ninja.elementMediator.setProperty([this.parentComponent.parentComponent.animatedElement], "left", [currentLeft], "Change", "tween");
258 }
253 } 259 }
254 }, 260 },
255 261