aboutsummaryrefslogtreecommitdiff
path: root/js/panels/Timeline
diff options
context:
space:
mode:
Diffstat (limited to 'js/panels/Timeline')
-rw-r--r--js/panels/Timeline/Layer.reel/Layer.js2
-rw-r--r--js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js40
2 files changed, 36 insertions, 6 deletions
diff --git a/js/panels/Timeline/Layer.reel/Layer.js b/js/panels/Timeline/Layer.reel/Layer.js
index 3bc87f68..36c77018 100644
--- a/js/panels/Timeline/Layer.reel/Layer.js
+++ b/js/panels/Timeline/Layer.reel/Layer.js
@@ -758,6 +758,8 @@ var Layer = exports.Layer = Montage.create(Component, {
758 } 758 }
759 this.dynamicLayerName.value = newVal; 759 this.dynamicLayerName.value = newVal;
760 this.layerName = newVal; 760 this.layerName = newVal;
761 this.application.ninja.timeline.currentLayerSelected.layerData.elementsList[0].dataset.storedLayerName = newVal;
762 this.application.ninja.documentController.activeDocument.needsSave = true;
761 this.needsDraw = true; 763 this.needsDraw = true;
762 } 764 }
763 }, 765 },
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
index 89d5e258..0062affe 100644
--- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
+++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
@@ -502,6 +502,10 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
502 for (i = 0; i < arrEventsLength; i++) { 502 for (i = 0; i < arrEventsLength; i++) {
503 this.eventManager.removeEventListener(arrEvents[i], this, false); 503 this.eventManager.removeEventListener(arrEvents[i], this, false);
504 } 504 }
505 if (this._bindingDescriptors !== null) {
506 //console.log('Unbinding breadcrumbcontainer')
507 Object.deleteBinding(this, "breadCrumbContainer");
508 }
505 } else { 509 } else {
506 for (i = 0; i < arrEventsLength; i++) { 510 for (i = 0; i < arrEventsLength; i++) {
507 this.eventManager.addEventListener(arrEvents[i], this, false); 511 this.eventManager.addEventListener(arrEvents[i], this, false);
@@ -532,6 +536,14 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
532 // Initialize BreadCrumb 536 // Initialize BreadCrumb
533 this.application.ninja.breadCrumbClick = false; 537 this.application.ninja.breadCrumbClick = false;
534 this.enablePanel(false); 538 this.enablePanel(false);
539
540 /*
541 Object.defineBinding(this, "breadCrumbContainer", {
542 boundObject:this.application.ninja,
543 boundObjectPropertyPath:"currentSelectedContainer",
544 oneway:true
545 });
546 */
535 } 547 }
536 }, 548 },
537 549
@@ -539,12 +551,14 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
539 // Called when a document is opened (new or existing), or when documents are switched. 551 // Called when a document is opened (new or existing), or when documents are switched.
540 initTimelineForDocument:{ 552 initTimelineForDocument:{
541 value:function () { 553 value:function () {
542 var myIndex; 554 var myIndex,
555 boolAlreadyInitialized = false;
543 this.drawTimeMarkers(); 556 this.drawTimeMarkers();
544 // Document switching 557 // Document switching
545 // Check to see if we have saved timeline information in the currentDocument. 558 // Check to see if we have saved timeline information in the currentDocument.
546 if ((typeof(this.application.ninja.currentDocument.isTimelineInitialized) === "undefined") && 559 if ((typeof(this.application.ninja.currentDocument.isTimelineInitialized) === "undefined") &&
547 (!this.application.ninja.breadCrumbClick)) { 560 (!this.application.ninja.breadCrumbClick)) {
561 //console.log('TimelinePanel.initTimelineForDocument: new Document');
548 // No, we have no information stored. 562 // No, we have no information stored.
549 // This could mean we are creating a new file, OR are opening an existing file. 563 // This could mean we are creating a new file, OR are opening an existing file.
550 564
@@ -568,8 +582,10 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
568 // Draw the repetition. 582 // Draw the repetition.
569 this.arrLayers = this.temparrLayers; 583 this.arrLayers = this.temparrLayers;
570 this.currentLayerNumber = this.arrLayers.length; 584 this.currentLayerNumber = this.arrLayers.length;
585 boolAlreadyInitialized = true;
571 586
572 } else if (this.application.ninja.breadCrumbClick) { 587 } else if (this.application.ninja.breadCrumbClick) {
588 //console.log('TimelinePanel.initTimelineForDocument: breadCrumbClick');
573 // Information stored, but we're moving up or down in the breadcrumb. 589 // Information stored, but we're moving up or down in the breadcrumb.
574 // Get the current selection and restore timeline info for its children. 590 // Get the current selection and restore timeline info for its children.
575 var parentNode = this.application.ninja.currentSelectedContainer, 591 var parentNode = this.application.ninja.currentSelectedContainer,
@@ -586,8 +602,10 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
586 this.currentLayerNumber = storedCurrentLayerNumber; 602 this.currentLayerNumber = storedCurrentLayerNumber;
587 this.currentLayerSelected = this.application.ninja.currentSelectedContainer; 603 this.currentLayerSelected = this.application.ninja.currentSelectedContainer;
588 // this.application.ninja.breadCrumbClick = false; 604 // this.application.ninja.breadCrumbClick = false;
605 boolAlreadyInitialized = true;
589 606
590 } else { 607 } else {
608 //console.log('TimelinePanel.initTimelineForDocument: else fallback');
591 // we do have information stored. Use it. 609 // we do have information stored. Use it.
592 var i = 0, 610 var i = 0,
593 tlArrLayersLength = this.application.ninja.currentDocument.tlArrLayers.length; 611 tlArrLayersLength = this.application.ninja.currentDocument.tlArrLayers.length;
@@ -621,6 +639,9 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
621 639
622 // Ok, done reading from the cache. 640 // Ok, done reading from the cache.
623 this._boolCacheArrays = true; 641 this._boolCacheArrays = true;
642
643 // Reset master duration
644 this.resetMasterDuration();
624 } 645 }
625 } 646 }
626 }, 647 },
@@ -661,6 +682,10 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
661 handleDocumentChange:{ 682 handleDocumentChange:{
662 value:function (event) { 683 value:function (event) {
663 // Clear the timeline but not the cache 684 // Clear the timeline but not the cache
685 //console.log('TimelinePanel.handleDocumentChange');
686 if ((event.type === "closeDocument") && (this.application.ninja.documentController._documents.length > 0)) {
687 return;
688 }
664 this._boolCacheArrays = false; 689 this._boolCacheArrays = false;
665 this.clearTimelinePanel(); 690 this.clearTimelinePanel();
666 this._boolCacheArrays = true; 691 this._boolCacheArrays = true;
@@ -672,6 +697,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
672 if (this.application.ninja.documentController._documents.length > 0) { 697 if (this.application.ninja.documentController._documents.length > 0) {
673 this.enablePanel(true); 698 this.enablePanel(true);
674 this.initTimelineForDocument(); 699 this.initTimelineForDocument();
700
675 } else { 701 } else {
676 this.enablePanel(false); 702 this.enablePanel(false);
677 } 703 }
@@ -750,15 +776,17 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
750 776
751 LayerBinding:{ 777 LayerBinding:{
752 value:function (node) { 778 value:function (node) {
753 var i = 0; 779 // var i = 0;
754 780 /*
755 if (this._firstTimeLoaded === true) { 781 if (this._firstTimeLoaded === true) {
756 this._firstTimeLoaded = false; 782 this._firstTimeLoaded = false;
757 return; 783 return;
758 } 784 }
759 785 */
760 this.handleDocumentChange(); 786 if (this.application.ninja.breadCrumbClick === true) {
761 // this.application.ninja.breadCrumbClick=false; 787 //console.log('TimelinePanel.LayerBinding: firing this.handleDocumentChange')
788 this.handleDocumentChange();
789 }
762 } 790 }
763 }, 791 },
764 792