aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js3055
1 files changed, 1535 insertions, 1520 deletions
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
index 6e9513f2..a5737334 100644
--- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
+++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
@@ -1,1521 +1,1536 @@
1/* <copyright> 1/* <copyright>
2 This file contains proprietary software owned by Motorola Mobility, Inc.<br/> 2 This file contains proprietary software owned by Motorola Mobility, Inc.<br/>
3 No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/> 3 No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/>
4 (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. 4 (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved.
5 </copyright> */ 5 </copyright> */
6 6
7var Montage = require("montage/core/core").Montage; 7var Montage = require("montage/core/core").Montage;
8var Component = require("montage/ui/component").Component; 8var Component = require("montage/ui/component").Component;
9var nj = require("js/lib/NJUtils").NJUtils; 9var nj = require("js/lib/NJUtils").NJUtils;
10 10
11var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { 11var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
12 12
13 hasTemplate:{ 13 hasTemplate:{
14 value:true 14 value:true
15 }, 15 },
16 16
17 /* === BEGIN: Models === */ 17 /* === BEGIN: Models === */
18 _currentDocument: { 18 _currentDocument: {
19 value : null 19 value : null
20 }, 20 },
21 21
22 currentDocument : { 22 currentDocument : {
23 get : function() { 23 get : function() {
24 return this._currentDocument; 24 return this._currentDocument;
25 }, 25 },
26 set : function(value) { 26 set : function(value) {
27 if (value === this._currentDocument) { 27 // If it's the same document, do nothing.
28 return; 28 if (value === this._currentDocument) {
29 } 29 return;
30 30 }
31 if(!this._currentDocument && value.currentView === "design") { 31
32 this.enablePanel(true); 32 if(!this._currentDocument && value.currentView === "design") {
33 } 33 this.enablePanel(true);
34 34 }
35 this._currentDocument = value; 35
36 36 this._currentDocument = value;
37 if(!value) { 37
38 this.enablePanel(false); 38 if(!value) {
39 } else if(this._currentDocument.currentView === "design") { 39 this._boolCacheArrays = false;
40 this._boolCacheArrays = false; 40 this.clearTimelinePanel();
41 this.clearTimelinePanel(); 41 this._boolCacheArrays = true;
42 this._boolCacheArrays = true; 42 this.enablePanel(false);
43 43 } else if(this._currentDocument.currentView === "design") {
44 // Rebind the document events for the new document context 44 this._boolCacheArrays = false;
45 this._bindDocumentEvents(); 45 this.clearTimelinePanel();
46 46 this._boolCacheArrays = true;
47 // TODO: Fix the init function so that it can be called here instead of when container changes 47
48 // this.initTimelineForDocument(); 48 // Rebind the document events for the new document context
49 } 49 this._bindDocumentEvents();
50 } 50
51 }, 51 // Initialize the timeline for the document.
52 52 this.initTimelineForDocument();
53 _arrLayers:{ 53 }
54 value:[] 54 }
55 }, 55 },
56 56
57 arrLayers:{ 57 _currentSelectedContainer: {
58 serializable:true, 58 value: null
59 get:function () { 59 },
60 return this._arrLayers; 60 currentSelectedContainer: {
61 }, 61 get: function() {
62 set:function (newVal) { 62 return this._currentSelectedContainer;
63 this._arrLayers = newVal; 63 },
64 this.needsDraw = true; 64 set: function(newVal) {
65 this.cacheTimeline(); 65 if(this._currentSelectedContainer !== newVal) {
66 } 66 this._currentSelectedContainer = newVal;
67 }, 67 if (this._ignoreNextContainerChange === true) {
68 68 this._ignoreNextContainerChange = false;
69 _temparrLayers:{ 69 return;
70 value:[] 70 }
71 }, 71 this.application.ninja.currentDocument.setLevel = true;
72 72
73 temparrLayers:{ 73 if(this._currentDocument.currentView === "design") {
74 get:function () { 74 this._boolCacheArrays = false;
75 return this._temparrLayers; 75 this.clearTimelinePanel();
76 }, 76 this._boolCacheArrays = true;
77 set:function (newVal) { 77
78 this._temparrLayers = newVal; 78 // Rebind the document events for the new document context
79 } 79 this._bindDocumentEvents();
80 }, 80
81 81 // Initialize the timeline for the document.
82 82 this.initTimelineForDocument();
83 _layerRepetition:{ 83 }
84 value:null 84 }
85 }, 85 }
86 86 },
87 layerRepetition:{ 87
88 get:function () { 88 _arrLayers:{
89 return this._layerRepetition; 89 value:[]
90 }, 90 },
91 set:function (newVal) { 91
92 this._layerRepetition = newVal; 92 arrLayers:{
93 } 93 serializable:true,
94 }, 94 get:function () {
95 95 return this._arrLayers;
96 // Set to false to skip array caching array sets in current document 96 },
97 _boolCacheArrays:{ 97 set:function (newVal) {
98 value:true 98 this._arrLayers = newVal;
99 }, 99 this.needsDraw = true;
100 100 this.cacheTimeline();
101 _currentLayerNumber:{ 101 }
102 value:0 102 },
103 }, 103
104 104 _temparrLayers:{
105 currentLayerNumber:{ 105 value:[]
106 get:function () { 106 },
107 return this._currentLayerNumber; 107
108 }, 108 temparrLayers:{
109 set:function (newVal) { 109 get:function () {
110 if (newVal !== this._currentLayerNumber) { 110 return this._temparrLayers;
111 this._currentLayerNumber = newVal; 111 },
112 this.cacheTimeline(); 112 set:function (newVal) {
113 } 113 this._temparrLayers = newVal;
114 } 114 }
115 }, 115 },
116 116
117 _currentLayerSelected:{ 117
118 value: false 118 _layerRepetition:{
119 }, 119 value:null
120 currentLayerSelected:{ 120 },
121 get:function () { 121
122 return this._currentLayerSelected; 122 layerRepetition:{
123 }, 123 get:function () {
124 set:function (newVal) { 124 return this._layerRepetition;
125 this._currentLayerSelected = newVal; 125 },
126 this.cacheTimeline(); 126 set:function (newVal) {
127 } 127 this._layerRepetition = newVal;
128 }, 128 }
129 129 },
130 _selectedLayerID:{ 130
131 value:false 131 // Set to false to skip array caching array sets in current document
132 }, 132 _boolCacheArrays:{
133 selectedLayerID:{ 133 value:true
134 get:function () { 134 },
135 return this._selectedLayerID; 135
136 }, 136 _currentLayerNumber:{
137 set:function (newVal) { 137 value:0
138 if (newVal === false) { 138 },
139 // We are clearing the timeline, so just set the value and return. 139
140 this._selectedLayerID = newVal; 140 currentLayerNumber:{
141 return; 141 get:function () {
142 }