aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xjs/ninja.reel/ninja.js2
-rw-r--r--js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js23
2 files changed, 21 insertions, 4 deletions
diff --git a/js/ninja.reel/ninja.js b/js/ninja.reel/ninja.js
index 61cd2487..9b1db2a3 100755
--- a/js/ninja.reel/ninja.js
+++ b/js/ninja.reel/ninja.js
@@ -321,7 +321,7 @@ exports.Ninja = Montage.create(Component, {
321 window.addEventListener("resize", this, false); 321 window.addEventListener("resize", this, false);
322 //Prompting the user to make sure data was saved before closing Ninja 322 //Prompting the user to make sure data was saved before closing Ninja
323 window.onbeforeunload = function () { 323 window.onbeforeunload = function () {
324 return 'Are you sure you want to close Ninja? Any unsaved data will be lost.'; 324 //return 'Are you sure you want to close Ninja? Any unsaved data will be lost.';
325 }; 325 };
326 326
327 this.eventManager.addEventListener("selectTool", this, false); 327 this.eventManager.addEventListener("selectTool", this, false);
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){