diff options
Diffstat (limited to 'js/panels')
-rw-r--r-- | js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | 50 |
1 files changed, 41 insertions, 9 deletions
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js index c8caf50e..96be66e8 100644 --- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js +++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | |||
@@ -733,11 +733,26 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
733 | if (this._boolCacheArrays) { | 733 | if (this._boolCacheArrays) { |
734 | // ... but only if we're supposed to. | 734 | // ... but only if we're supposed to. |
735 | if(this.currentDocument) { | 735 | if(this.currentDocument) { |
736 | var i = 0, | ||
737 | hashLength = this.application.ninja.currentDocument.tlBreadcrumbHash.length, | ||
738 | boolHash = false; | ||
739 | |||
736 | this.application.ninja.currentDocument.tlArrLayers = this.arrLayers; | 740 | this.application.ninja.currentDocument.tlArrLayers = this.arrLayers; |
737 | this.application.ninja.currentDocument.tlCurrentSelectedContainer = this.currentDocument.model.domContainer; | 741 | this.application.ninja.currentDocument.tlCurrentSelectedContainer = this.currentDocument.model.domContainer; |
738 | this.application.ninja.currentDocument.tllayerNumber = this.currentLayerNumber; | 742 | this.application.ninja.currentDocument.tllayerNumber = this.currentLayerNumber; |
739 | this.application.ninja.currentDocument.tlCurrentLayerSelected = this.currentLayerSelected; | 743 | this.application.ninja.currentDocument.tlCurrentLayerSelected = this.currentLayerSelected; |
740 | this.application.ninja.currentDocument.tlCurrentLayersSelected = this.currentLayersSelected; | 744 | this.application.ninja.currentDocument.tlCurrentLayersSelected = this.currentLayersSelected; |
745 | for (i = 0; i < hashLength; i++ ) { | ||
746 | if (this.application.ninja.currentDocument.tlBreadcrumbHash[i].containerUuid === this.currentDocument.model.domContainer.uuid) { | ||
747 | boolHash = true; | ||
748 | } | ||
749 | } | ||
750 | if (boolHash === false) { | ||
751 | var newHash = {}; | ||
752 | newHash.containerUuid = this.currentDocument.model.domContainer.uuid; | ||
753 | newHash.arrLayers = this.arrLayers; | ||
754 | this.application.ninja.currentDocument.tlBreadcrumbHash.push(newHash); | ||
755 | } | ||
741 | } | 756 | } |
742 | this.application.ninja.currentDocument.tlCurrentElementsSelected = this.currentElementsSelected; | 757 | this.application.ninja.currentDocument.tlCurrentElementsSelected = this.currentElementsSelected; |
743 | } | 758 | } |
@@ -754,6 +769,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
754 | this.application.ninja.currentDocument.tlCurrentLayerSelected = false; | 769 | this.application.ninja.currentDocument.tlCurrentLayerSelected = false; |
755 | this.application.ninja.currentDocument.tlCurrentLayersSelected = false; | 770 | this.application.ninja.currentDocument.tlCurrentLayersSelected = false; |
756 | this.application.ninja.currentDocument.tlCurrentElementsSelected = []; | 771 | this.application.ninja.currentDocument.tlCurrentElementsSelected = []; |
772 | this.application.ninja.currentDocument.tlBreadcrumbHash = []; | ||
757 | } | 773 | } |
758 | }, | 774 | }, |
759 | 775 | ||
@@ -934,20 +950,36 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
934 | } else if (this.application.ninja.currentDocument.setLevel) { | 950 | } else if (this.application.ninja.currentDocument.setLevel) { |
935 | // console.log('TimelinePanel.initTimelineForDocument: breadCrumbClick'); | 951 | // console.log('TimelinePanel.initTimelineForDocument: breadCrumbClick'); |
936 | // Information stored, but we're moving up or down in the breadcrumb. | 952 | // Information stored, but we're moving up or down in the breadcrumb. |
937 | // Get the current selection and restore timeline info for its children. | 953 | |
938 | var parentNode = this.currentDocument.model.domContainer, | 954 | var i = 0, |
955 | hash = this.application.ninja.currentDocument.tlBreadcrumbHash, | ||
956 | hashLength = hash.length, | ||
957 | boolHashed = false, | ||
958 | parentNode = this.currentDocument.model.domContainer, | ||
939 | storedCurrentLayerNumber = this.application.ninja.currentDocument.tllayerNumber; | 959 | storedCurrentLayerNumber = this.application.ninja.currentDocument.tllayerNumber; |
940 | this.temparrLayers = []; | 960 | this.temparrLayers = []; |
941 | 961 | ||
942 | for (myIndex = 0; parentNode.children[myIndex]; myIndex++) { | 962 | // It's possible there is something stored in the breadcrumb hash in currentdocument, so check there first. |
943 | this._openDoc = true; | 963 | for (i = 0; i < hashLength; i++ ) { |
944 | this.restoreLayer(parentNode.children[myIndex]); | 964 | if (hash[i].containerUuid === this.currentDocument.model.domContainer.uuid) { |
945 | 965 | this.temparrLayers = hash[i].arrLayers | |
946 | } | 966 | boolHashed = true; |
967 | } | ||
968 | } | ||
969 | |||
970 | // Possibly nothing was in the hash, so check and if so fall back to old restoreLayer method. | ||
971 | if (boolHashed === false) { | ||
972 | for (myIndex = 0; parentNode.children[myIndex]; myIndex++) { | ||
973 | this._openDoc = true; | ||
974 | this.restoreLayer(parentNode.children[myIndex]); | ||
975 | } | ||
976 | } | ||
977 | |||
947 | // Draw the repetition. | 978 | // Draw the repetition. |
948 | this.arrLayers = this.temparrLayers; | 979 | this.arrLayers = this.temparrLayers; |
949 | this.currentLayerNumber = storedCurrentLayerNumber; | 980 | this.currentLayerNumber = storedCurrentLayerNumber; |
950 | this.application.ninja.currentDocument.setLevel = false; | 981 | this.application.ninja.currentDocument.setLevel = false; |
982 | this.resetMasterDuration(); | ||
951 | 983 | ||
952 | } else { | 984 | } else { |
953 | // console.log('TimelinePanel.initTimelineForDocument: else fallback'); | 985 | // console.log('TimelinePanel.initTimelineForDocument: else fallback'); |