aboutsummaryrefslogtreecommitdiff
path: root/js/panels/Timeline
diff options
context:
space:
mode:
authorJon Reid2012-06-15 13:20:46 -0700
committerJon Reid2012-06-15 13:20:46 -0700
commit8dc456d59bd7dfc9c080a0241fa72d89aa4db70e (patch)
treeb57168f0c852a3e20c1f56d6c27f15b808a48bf4 /js/panels/Timeline
parentbab9944125d289e36de72c24fe56e6a98152307d (diff)
downloadninja-8dc456d59bd7dfc9c080a0241fa72d89aa4db70e.tar.gz
Timeline: fix for IKNINJA-1676, "Timeline: Can't insert a keyframe to a CSS
property after deleting one"
Diffstat (limited to 'js/panels/Timeline')
-rw-r--r--js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js23
1 files changed, 20 insertions, 3 deletions
diff --git a/js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js b/js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js
index 925d4a9d..791239d7 100644
--- a/js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js
+++ b/js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js
@@ -188,14 +188,16 @@ var PropertyTrack = exports.PropertyTrack = Montage.create(Component, {
188 188
189 // check if there is an editor property assigned yet 189 // check if there is an editor property assigned yet
190 // get this property track's editor prop name from layer data arrays 190 // get this property track's editor prop name from layer data arrays
191 var selectIndex = this.application.ninja.timeline.getLayerIndexByID(this.trackID); 191 var selectIndex = this.application.ninja.timeline.getLayerIndexByID(this.trackID),
192 currentSelectedStyleIndex = this.getCurrentSelectedStyleIndex(selectIndex);
192 193
193 if (this.trackType == "style") { 194 if (this.trackType == "style") {
194 if (this.application.ninja.timeline.arrLayers[selectIndex].layerData.arrLayerStyles[this.styleIndex].editorProperty == null) { 195 //console.log("PropertyTrack.handleClick; selectIndex = ", selectIndex, "; styleIndex = ", currentSelectedStyleIndex)
196 if (this.application.ninja.timeline.arrLayers[selectIndex].layerData.arrLayerStyles[currentSelectedStyleIndex].editorProperty == null) {
195 console.log("Please enter a style property for this track before adding keyframes."); 197 console.log("Please enter a style property for this track before adding keyframes.");
196 return; 198 return;
197 } else { 199 } else {
198 this.trackEditorProperty = this.application.ninja.timeline.arrLayers[selectIndex].layerData.arrLayerStyles[this.styleIndex].editorProperty; 200 this.trackEditorProperty = this.application.ninja.timeline.arrLayers[selectIndex].layerData.arrLayerStyles[currentSelectedStyleIndex].editorProperty;
199 //console.log("Property track editorProperty set to: " + this.trackEditorProperty); 201 //console.log("Property track editorProperty set to: " + this.trackEditorProperty);
200 } 202 }
201 } else if (this.trackType == "position") { 203 } else if (this.trackType == "position") {
@@ -212,6 +214,21 @@ var PropertyTrack = exports.PropertyTrack = Montage.create(Component, {
212 } 214 }
213 } 215 }
214 }, 216 },
217
218 getCurrentSelectedStyleIndex: {
219 value: function(layerIndex) {
220 var returnVal = false,
221 i = 0,
222 arrLayerStylesLength = this.application.ninja.timeline.arrLayers[layerIndex].layerData.arrLayerStyles.length;
223 for (i = 0; i < arrLayerStylesLength; i++) {
224 var currItem = this.application.ninja.timeline.arrLayers[layerIndex].layerData.arrLayerStyles[i];
225 if (currItem.isSelected === true) {
226 returnVal = i;
227 }
228 }
229 return returnVal;
230 }
231 },
215 232
216 handleNewPropTween:{ 233 handleNewPropTween:{
217 value:function(ev){ 234 value:function(ev){