aboutsummaryrefslogtreecommitdiff
path: root/js/panels
diff options
context:
space:
mode:
authorJon Reid2012-03-27 18:22:10 -0700
committerJon Reid2012-03-27 18:22:10 -0700
commit7845d312396e3329ac9246d4c13e99cb623216d5 (patch)
treee0b42cec27c8598545af5c3754d1f20146f436e4 /js/panels
parent06f247d881f4cfd790d635c6e310ae7f97724339 (diff)
downloadninja-7845d312396e3329ac9246d4c13e99cb623216d5.tar.gz
Timeline: Stability fixes for drag-and-drop and page switching.
Diffstat (limited to 'js/panels')
-rw-r--r--js/panels/Timeline/Layer.reel/Layer.js3
-rw-r--r--js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js16
-rw-r--r--js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js17
3 files changed, 22 insertions, 14 deletions
diff --git a/js/panels/Timeline/Layer.reel/Layer.js b/js/panels/Timeline/Layer.reel/Layer.js
index 9cf321b1..c69f28b0 100644
--- a/js/panels/Timeline/Layer.reel/Layer.js
+++ b/js/panels/Timeline/Layer.reel/Layer.js
@@ -417,6 +417,9 @@ var Layer = exports.Layer = Montage.create(Component, {
417 417
418 setData:{ 418 setData:{
419 value:function(){ 419 value:function(){
420 if (typeof(this.layerData) === "undefined") {
421 return;
422 }
420 this.layerName = this.layerData.layerName; 423 this.layerName = this.layerData.layerName;
421 this.layerID = this.layerData.layerID; 424 this.layerID = this.layerData.layerID;
422 this.arrLayerStyles = this.layerData.arrLayerStyles; 425 this.arrLayerStyles = this.layerData.arrLayerStyles;
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
index cb133f58..a82d3373 100644
--- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
+++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
@@ -294,17 +294,13 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
294 if (newVal !== this._dropLayerID) { 294 if (newVal !== this._dropLayerID) {
295 this._dropLayerID = newVal; 295 this._dropLayerID = newVal;
296 296
297 // Create a snapshot of arrLayers so we can manipulate it safely 297 var dragLayerIndex = this.getLayerIndexByID(this.dragLayerID),
298 var arrLayers = this.arrLayers,
299 dragLayerIndex = this.getLayerIndexByID(this.dragLayerID),
300 dropLayerIndex = this.getLayerIndexByID(this.dropLayerID), 298 dropLayerIndex = this.getLayerIndexByID(this.dropLayerID),
301 dragLayer = arrLayers[dragLayerIndex]; 299 dragLayer = this.arrLayers[dragLayerIndex];
302 300
303 arrLayers.splice(dragLayerIndex, 1); 301 this.arrLayers.splice(dragLayerIndex, 1);
304 arrLayers.splice(dropLayerIndex, 0, dragLayer); 302 this.arrLayers.splice(dropLayerIndex, 0, dragLayer);
305 303 this.application.ninja.currentDocument.tlArrLayers = this.arrLayers;
306 // Update the repetition!
307 this.arrLayers = arrLayers;
308 304
309 // Clear for future DnD 305 // Clear for future DnD
310 this._dropLayerID = null; 306 this._dropLayerID = null;
diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
index 5e9868f0..978b239f 100644
--- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
+++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
@@ -381,6 +381,9 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
381 381
382 setData:{ 382 setData:{
383 value:function(){ 383 value:function(){
384 if (typeof(this.trackData) === "undefined") {
385 return;
386 }
384 this.bypassAnimation = this.trackData.bypassAnimation; 387 this.bypassAnimation = this.trackData.bypassAnimation;
385 this.trackID = this.trackData.layerID; 388 this.trackID = this.trackData.layerID;
386 this.tweens = this.trackData.tweens; 389 this.tweens = this.trackData.tweens;
@@ -439,9 +442,12 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
439 value:function () { 442 value:function () {
440 this.ninjaStylesContoller = this.application.ninja.stylesController; 443 this.ninjaStylesContoller = this.application.ninja.stylesController;
441 var selectedIndex = this.application.ninja.timeline.getLayerIndexByID(this.trackID); 444 var selectedIndex = this.application.ninja.timeline.getLayerIndexByID(this.trackID);
442 if(this.application.ninja.timeline.arrLayers[selectedIndex].layerData.elementsList[0]){ 445 if (selectedIndex !== false) {
443 this.animatedElement = this.application.ninja.timeline.arrLayers[selectedIndex].layerData.elementsList[0]; 446 if(this.application.ninja.timeline.arrLayers[selectedIndex].layerData.elementsList[0]){
447 this.animatedElement = this.application.ninja.timeline.arrLayers[selectedIndex].layerData.elementsList[0];
448 }
444 } 449 }
450
445 } 451 }
446 }, 452 },
447 453
@@ -450,9 +456,12 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
450 if (!this.application.ninja.documentController.creatingNewFile) { 456 if (!this.application.ninja.documentController.creatingNewFile) {
451 if (this.application.ninja.currentDocument.documentRoot.children[0]) { 457 if (this.application.ninja.currentDocument.documentRoot.children[0]) {
452 var selectedIndex = this.application.ninja.timeline.getLayerIndexByID(this.trackID); 458 var selectedIndex = this.application.ninja.timeline.getLayerIndexByID(this.trackID);
453 if (!this.application.ninja.timeline.arrLayers[selectedIndex].layerData.created) { 459 if (selectedIndex !== false) {
454 this.retrieveStoredTweens(); 460 if (!this.application.ninja.timeline.arrLayers[selectedIndex].layerData.created) {
461 this.retrieveStoredTweens();
462 }
455 } 463 }
464
456 } 465 }
457 } 466 }
458 } 467 }